[Webkit-unassigned] [Bug 180308] WTF shouldn't have both Thread and ThreadIdentifier

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 2 01:04:57 PST 2017


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

--- Comment #1 from Yusuke Suzuki <utatane.tea at gmail.com> ---
I have several thoughts about ThreadIdentifier.
But I *like* this change: we should use Thread instead of ThreadIdentifier. This is apparently nice.

I remember that some places use RefPtr<Thread> explicitly since it may be nullptr.
Personally I think Ref<Thread> is good to describe Thread is not nullptr.

And I believe Thread::create should return Ref<Thread> instead of RefPtr<>.
When we failed to spawn a thread, we would not have a good way to keep WebKit working.
It would be good to add Thread::tryCreate and use it for some specific places.

1. Some WebCore code just holds ThreadIdentifier.
Such program assumes that ThreadIdentifier is monotonocally increasing...
So when refactoring, we need to keep this thing in our mind.

Note that the above assumption is already broken in Windows. And replacing it with Ref<Thread> would work. And this use is mainly used for debugging.

2. In Windows, some internal blobs (That’s used for AppleWin and WinCairo) uses WTF’s old threading.
I’m not sure about it much. But when removing createThread API, it causes build error. So I kept old createThread API over Thread::create.

I think it returns ThreadIdentifier. So at least in Windows, we need to keep it even if it is not used for the other WebKit code.

But I think it’s not a problem. Since Windows’ ThreadIdentifier is system provided TID, we can just use it.

-- 
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/20171202/ffb7d0b9/attachment.html>


More information about the webkit-unassigned mailing list