[Webkit-unassigned] [Bug 195605] makeWeakPtr isn't thread-safe

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 12 10:03:46 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=195605

--- Comment #5 from Geoffrey Garen <ggaren at apple.com> ---
Honestly, it's probably a bug that WeakReference is ThreadSafeRefCounted. (It should just be RefCounted.) None of the data in WeakPtr, WeakReference, or WeakPtrFactory is thread-safe.

I left WeakReference ThreadSafeRefCounted out of an abundance of caution, because it was originally written that way and I didn't know if there any clients needed the atomic reference count.

If we wanted a thread-safe approach to weak references, we could create one, and it would be a distinct class with a distinct implementation. (All operations would need to be atomic, get() and operator->() would need to return RefPtr, and operator*() would need to return Ref.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190312/523d5f7a/attachment.html>


More information about the webkit-unassigned mailing list