]> granicus.if.org Git - clang/commit
[NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable
authorPuyan Lotfi <puyan@puyan.org>
Tue, 6 Aug 2019 01:26:46 +0000 (01:26 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Tue, 6 Aug 2019 01:26:46 +0000 (01:26 +0000)
commit26d2be17f068e993a0213347c158022cb5ab28b7
tree39ae4fdd6f0e9dc149ded2c71bf1da8c08e75f89
parentcf6324a4dbef025117e50e9ad76bbc5f88b05de9
[NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable

This should not affect actual behavior, but should pessimize the threading less
by avoiding the situation where:

  * mutex is still locked
  * T1 notifies on condition variable
  * T2 wakes to check mutex
  * T2 sees mutex is still locked
  * T2 waits
  * T1 unlocks mutex
  * T2 tries again, acquires mutex.

Differential Revision: https://reviews.llvm.org/D65708

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367968 91177308-0d34-0410-b5e6-96231b3b80d8
unittests/DirectoryWatcher/DirectoryWatcherTest.cpp