diff options
Diffstat (limited to 'lib/thread.rb')
-rw-r--r-- | lib/thread.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/thread.rb b/lib/thread.rb index 8f7f6cdd6a..c47d7b20a4 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -69,6 +69,10 @@ class Mutex unlock end end + + def num_waiting + @waiting.size + end end class Queue @@ -137,4 +141,8 @@ class SizedQueue<Queue pop = super pop end + + def num_waiting + @waiting.size + @queue_wait.size + end end |