We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6d84d1 commit 8487468Copy full SHA for 8487468
port/port_win.cc
@@ -109,12 +109,10 @@ void CondVar::Signal() {
109
110
void CondVar::SignalAll() {
111
wait_mtx_.Lock();
112
- for(long i = 0; i < waiting_; ++i) {
113
- ::ReleaseSemaphore(sem1_, 1, NULL);
114
- while(waiting_ > 0) {
115
- --waiting_;
116
- ::WaitForSingleObject(sem2_, INFINITE);
117
- }
+ ::ReleaseSemaphore(sem1_, waiting_, NULL);
+ while(waiting_ > 0) {
+ --waiting_;
+ ::WaitForSingleObject(sem2_, INFINITE);
118
}
119
wait_mtx_.Unlock();
120
0 commit comments