mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 00:15:51 +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() {
|
void CondVar::SignalAll() {
|
||||||
wait_mtx_.Lock();
|
wait_mtx_.Lock();
|
||||||
for(long i = 0; i < waiting_; ++i) {
|
::ReleaseSemaphore(sem1_, waiting_, NULL);
|
||||||
::ReleaseSemaphore(sem1_, 1, NULL);
|
while(waiting_ > 0) {
|
||||||
while(waiting_ > 0) {
|
--waiting_;
|
||||||
--waiting_;
|
::WaitForSingleObject(sem2_, INFINITE);
|
||||||
::WaitForSingleObject(sem2_, INFINITE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
wait_mtx_.Unlock();
|
wait_mtx_.Unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user