public static RubyConditionVariable/*!*/ Broadcast(RubyConditionVariable/*!*/ self) { RubyMutex m = self._mutex; if (m != null) { Monitor.PulseAll(m); } return self; }
public static RubyConditionVariable /*!*/ Broadcast(RubyConditionVariable /*!*/ self) { RubyMutex m = self._mutex; if (m != null) { lock (self._lock) { int waits = self._waits; for (int i = 0; i < waits; i++) { self._signal.Set(); // // WARNING // // There is no guarantee that every call to the Set method will release a waiting thread. // If two calls are too close together, so that the second call occurs before a thread // has been released, only one thread is released. // We add a sleep to increase the chance that all waiting threads will be released. // Thread.CurrentThread.Join(1); } } } return(self); }
public static RubyConditionVariable/*!*/ Signal(RubyConditionVariable/*!*/ self) { RubyMutex m = self._mutex; if (m != null) { self._signal.Set(); } return self; }
public static RubyConditionVariable/*!*/ Signal(RubyConditionVariable/*!*/ self) { RubyMutex m = self._mutex; if (m != null) { Monitor.Pulse(m); } return self; }
public static RubyConditionVariable /*!*/ Signal(RubyConditionVariable /*!*/ self) { RubyMutex m = self._mutex; if (m != null) { self._signal.Set(); } return(self); }
public static RubyConditionVariable /*!*/ Broadcast(RubyConditionVariable /*!*/ self) { RubyMutex m = self._mutex; if (m != null) { Monitor.PulseAll(m); } return(self); }
public static RubyConditionVariable /*!*/ Signal(RubyConditionVariable /*!*/ self) { RubyMutex m = self._mutex; if (m != null) { Monitor.Pulse(m); } return(self); }
public static RubyConditionVariable/*!*/ Wait(RubyConditionVariable/*!*/ self, [NotNull]RubyMutex/*!*/ mutex) { self._mutex = mutex; RubyMutex.Unlock(mutex); lock (self._lock) { self._waits++; } self._signal.WaitOne(); lock (self._lock) { self._waits--; } RubyMutex.Lock(mutex); return self; }
public static RubyConditionVariable /*!*/ Wait(RubyConditionVariable /*!*/ self, [NotNull] RubyMutex /*!*/ mutex) { self._mutex = mutex; RubyMutex.Unlock(mutex); lock (self._lock) { self._waits++; } self._signal.WaitOne(); lock (self._lock) { self._waits--; } RubyMutex.Lock(mutex); return(self); }
public static RubyConditionVariable/*!*/ Broadcast(RubyConditionVariable/*!*/ self) { RubyMutex m = self._mutex; if (m != null) { lock (self._lock) { int waits = self._waits; for (int i = 0; i < waits; i++) { self._signal.Set(); // // WARNING // // There is no guarantee that every call to the Set method will release a waiting thread. // If two calls are too close together, so that the second call occurs before a thread // has been released, only one thread is released. // We add a sleep to increase the chance that all waiting threads will be released. // Thread.CurrentThread.Join(1); } } } return self; }
public static RubyConditionVariable/*!*/ Wait(RubyConditionVariable/*!*/ self, [NotNull]RubyMutex/*!*/ mutex) { self._mutex = mutex; Monitor.Wait(mutex.Mutex); return self; }
public static RubyConditionVariable /*!*/ Wait(RubyConditionVariable /*!*/ self, [NotNull] RubyMutex /*!*/ mutex) { self._mutex = mutex; Monitor.Wait(mutex.Mutex); return(self); }