mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
rt: Remove lock_and_signal::signal_all
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user