summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-13 09:40:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-13 09:40:29 +0000
commit1b7f82e62577986a6122ef453323ace74980d91e (patch)
tree3518499de338e8c28ec5daaa1396b381e9676e66 /lib/thread.rb
parent00080ffcbb05cf23bce8e31f0538567f5b780f89 (diff)
\s and assignment in conditional
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@72 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb8
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