WorkQueueGeneric's platformInvalidate() can deadlock when called on the RunLoop's thread
https://bugs.webkit.org/show_bug.cgi?id=166645
Reviewed by Carlos Garcia Campos.
Source/WTF:
WorkQueue can be destroyed on its invoking thread itself.
The scenario is the following.
1. Create WorkQueue (in thread A).
2. Dispatch a task (in thread A, dispatching a task to thread B).
3. Deref in thread A.
4. The task is executed in thread B.
5. Deref in thread B.
6. The WorkQueue is destroyed, calling platformInvalidate in thread B.
In that case, if platformInvalidate waits thread B's termination, it causes deadlock.
We do not need to wait the thread termination.
* wtf/WorkQueue.h:
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::platformInitialize):
(WorkQueue::platformInvalidate):
Tools:
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210271
268f45cc-cd09-0410-ab3c-
d52691b4dbfc