Bug #9342 » 0002-Wake-waiting-threads-when-SizedQueue-clear-is-called-2.0.patch
| lib/thread.rb | ||
|---|---|---|
|   alias deq pop | ||
|   # | ||
|   # Removes all objects from the queue and wakes waiting threads, if any. | ||
|   # | ||
|   def clear | ||
|     @mutex.synchronize do | ||
|       @que.clear | ||
|       @enque_cond.signal | ||
|     end | ||
|   end | ||
|   # | ||
|   # Returns the number of threads waiting on the queue. | ||
|   # | ||
|   def num_waiting | ||
- « Previous
- 1
- 2
- Next »