Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r222945 - bmalloc mutex should be adaptive
https://bugs.webkit.org/show_bug.cgi?id=177839 Reviewed by Michael Saboff. Source/bmalloc: This pulls the WordLock algorithm into bmalloc, mostly by copy-pasting the code. We need to copy paste because sometimes we build WTF without bmalloc, so WTF cannot rely on bmalloc for anything other than malloc. Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held to ensure it doesn't run after that thread has died. * bmalloc/Algorithm.h: (bmalloc::compareExchangeWeak): (bmalloc::compareExchangeStrong): * bmalloc/PerThread.h: * bmalloc/StaticMutex.cpp: (bmalloc::StaticMutex::lockSlow): (bmalloc::StaticMutex::unlockSlow): (bmalloc::StaticMutex::lockSlowCase): Deleted. * bmalloc/StaticMutex.h: (bmalloc::StaticMutex::try_lock): (bmalloc::StaticMutex::isLocked const): (bmalloc::StaticMutex::init): (bmalloc::StaticMutex::tryLock): (bmalloc::StaticMutex::lock): (bmalloc::StaticMutex::unlock): (bmalloc::sleep): Deleted. (bmalloc::waitUntilFalse): Deleted. Source/WTF: Add some comments that I thought of while copy-pasting this code. Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held to ensure it doesn't run after that thread has died. * wtf/LockAlgorithmInlines.h: * wtf/WordLock.cpp:
- Loading branch information
1 parent
c7604b8
commit da333d1
Showing
8 changed files
with
350 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.