[WTF] ThreadGroupRemove test is flaky
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Aug 2019 04:33:58 +0000 (04:33 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Aug 2019 04:33:58 +0000 (04:33 +0000)
commitf1f7ce66325d99e95901ee216b7d1eddd5728798
treeeb6f7519353a65d97ae7967a00e77069b3a825ac
parent7d7d99ef83dc489c23e53c969d5a333c0337516c
[WTF] ThreadGroupRemove test is flaky
https://bugs.webkit.org/show_bug.cgi?id=200763

Reviewed by Mark Lam.

ThreadGroup.ThreadGroupRemove test is flaky since its `threadRunning` modification and check in Thread are racy.
It can lead to infinite wait on waitForCompletion. We should do more idiomatic to avoid race: When notifying condition
variables, we should first take a lock, modify the condition shared and notify the condition change while taking a lock,
and releasing the lock after that.

* TestWebKitAPI/Tests/WTF/ThreadGroup.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/ThreadGroup.cpp