Use WTF Locking primitives in WebThread and drop pthread_xxx use
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 01:26:27 +0000 (01:26 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 01:26:27 +0000 (01:26 +0000)
commitfe45d79540968f653ddc141d81a71d73da614f38
treee60121c03fc6d8db85ce4ab5401d1d965f33ef1b
parentdd3193f908bd5cc07f297380acb60e9e49ae68ac
Use WTF Locking primitives in WebThread and drop pthread_xxx use
https://bugs.webkit.org/show_bug.cgi?id=180445

Reviewed by Saam Barati.

Source/WebCore:

We remove use of pthread locking primitives from WebThread implementation,
and use WTF Lock and Condition instead.

No behavior change.

* platform/ios/wak/WebCoreThread.mm:
(HandleDelegateSource):
(SendDelegateMessage):
(WebThreadRunOnMainThread):
(WebThreadAdoptAndRelease):
(WebCoreObjCDeallocOnWebThreadImpl):
(WebCoreObjCDeallocWithWebThreadLockImpl):
(HandleWebThreadReleaseSource):
(_WebThreadAutoLock):
(WebRunLoopLockInternal):
(CurrentThreadContext):
Use WTF::ThreadSpecific.

(StartWebThread):
(_WebThreadLock):
Remove `shouldTry` parameter since it is always `false`. We clean up code based on `shouldTry = false`,
and rename it from _WebTryThreadLock to _WebThreadLock since it does not try now.

(_WebThreadLockFromAnyThread):
(WebThreadUnlockFromAnyThread):
(_WebThreadUnlock):
(lockWebCoreReleaseLock): Deleted.
(unlockWebCoreReleaseLock): Deleted.
(WebTimedConditionLock): Deleted.
(_WebTryThreadLock): Deleted.

Source/WTF:

Add initializer form to fill struct with zero if struct does not have any default initializers.

* wtf/ThreadSpecific.h:
(WTF::ThreadSpecific::Data::Data):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/ThreadSpecific.h
Source/WebCore/ChangeLog
Source/WebCore/platform/ios/wak/WebCoreThread.mm