rt: Remove lock_and_signal::signal_all
This commit is contained in:
parent
9c33f2c561
commit
3b4dd26ff1
3 changed files with 1 additions and 18 deletions
|
|
@ -358,7 +358,7 @@ rust_scheduler::exit() {
|
|||
A(this, !lock.lock_held_by_current_thread(), "Shouldn't have lock");
|
||||
scoped_lock with(lock);
|
||||
should_exit = true;
|
||||
lock.signal_all();
|
||||
lock.signal();
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -18,11 +18,6 @@
|
|||
lock_and_signal::lock_and_signal()
|
||||
: _holding_thread(INVALID_THREAD)
|
||||
{
|
||||
// FIXME: In order to match the behavior of pthread_cond_broadcast on
|
||||
// Windows, we create manual reset events. This however breaks the
|
||||
// behavior of pthread_cond_signal, fixing this is quite involved:
|
||||
// refer to: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
|
||||
|
||||
_event = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
InitializeCriticalSection(&_cs);
|
||||
}
|
||||
|
|
@ -92,17 +87,6 @@ void lock_and_signal::signal() {
|
|||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Signal condition, and resume all waiting threads.
|
||||
*/
|
||||
void lock_and_signal::signal_all() {
|
||||
#if defined(__WIN32__)
|
||||
SetEvent(_event);
|
||||
#else
|
||||
CHECKED(pthread_cond_broadcast(&_cond));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool lock_and_signal::lock_held_by_current_thread()
|
||||
{
|
||||
#if defined(__WIN32__)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ public:
|
|||
void unlock();
|
||||
void wait();
|
||||
void signal();
|
||||
void signal_all();
|
||||
|
||||
bool lock_held_by_current_thread();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue