mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 06:55:50 +00:00
CondVar::SignalAll was broken, leading to deadlocks on Windows builds.
http://code.google.com/p/leveldb/issues/detail?id=149
This commit is contained in:
@@ -109,12 +109,10 @@ void CondVar::Signal() {
|
||||
|
||||
void CondVar::SignalAll() {
|
||||
wait_mtx_.Lock();
|
||||
for(long i = 0; i < waiting_; ++i) {
|
||||
::ReleaseSemaphore(sem1_, 1, NULL);
|
||||
while(waiting_ > 0) {
|
||||
--waiting_;
|
||||
::WaitForSingleObject(sem2_, INFINITE);
|
||||
}
|
||||
::ReleaseSemaphore(sem1_, waiting_, NULL);
|
||||
while(waiting_ > 0) {
|
||||
--waiting_;
|
||||
::WaitForSingleObject(sem2_, INFINITE);
|
||||
}
|
||||
wait_mtx_.Unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user