Skip to content

Commit 3b4dd26

Browse files
committed
rt: Remove lock_and_signal::signal_all
1 parent 9c33f2c commit 3b4dd26

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

src/rt/rust_scheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ rust_scheduler::exit() {
358358
A(this, !lock.lock_held_by_current_thread(), "Shouldn't have lock");
359359
scoped_lock with(lock);
360360
should_exit = true;
361-
lock.signal_all();
361+
lock.signal();
362362
}
363363

364364
//

src/rt/sync/lock_and_signal.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
lock_and_signal::lock_and_signal()
1919
: _holding_thread(INVALID_THREAD)
2020
{
21-
// FIXME: In order to match the behavior of pthread_cond_broadcast on
22-
// Windows, we create manual reset events. This however breaks the
23-
// behavior of pthread_cond_signal, fixing this is quite involved:
24-
// refer to: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
25-
2621
_event = CreateEvent(NULL, TRUE, FALSE, NULL);
2722
InitializeCriticalSection(&_cs);
2823
}
@@ -92,17 +87,6 @@ void lock_and_signal::signal() {
9287
#endif
9388
}
9489

95-
/**
96-
* Signal condition, and resume all waiting threads.
97-
*/
98-
void lock_and_signal::signal_all() {
99-
#if defined(__WIN32__)
100-
SetEvent(_event);
101-
#else
102-
CHECKED(pthread_cond_broadcast(&_cond));
103-
#endif
104-
}
105-
10690
bool lock_and_signal::lock_held_by_current_thread()
10791
{
10892
#if defined(__WIN32__)

src/rt/sync/lock_and_signal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class lock_and_signal {
2222
void unlock();
2323
void wait();
2424
void signal();
25-
void signal_all();
2625

2726
bool lock_held_by_current_thread();
2827
};

0 commit comments

Comments
 (0)