summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-23 10:29:23 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-23 10:29:23 +0000
commit227d6793972c520848fb6bf0b73a17355dbdfb9c (patch)
tree602f7daba823bcef1b036e052c454506fcdbc06b /lib
parenta84a284a3bb0f4b66527ac1d90bca09094efdf1d (diff)
* lib/thread.rb: Synchronize with HEAD. The last change
(rev.1.9.2.2) against SizedQueue#max= was wrong and didn't fix the bug in question. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/thread.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 0537c78650..34db9c3d46 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -3,6 +3,7 @@
# $Date$
# by Yukihiro Matsumoto <matz@netlab.co.jp>
#
+# Copyright (C) 2001 Yukihiro Matsumoto
# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
#
@@ -168,9 +169,8 @@ class Queue
rescue ThreadError
end
end
- def enq(obj)
- push(obj)
- end
+ alias << push
+ alias enq push
def pop(non_block=false)
Thread.critical = true
@@ -198,7 +198,7 @@ class Queue
end
def clear
- @que.replace([])
+ @que.clear
end
def length
@@ -231,7 +231,7 @@ class SizedQueue<Queue
@max = max
Thread.critical = false
else
- diff = @max - max
+ diff = max - @max
@max = max
Thread.critical = false
diff.times do
@@ -255,6 +255,7 @@ class SizedQueue<Queue
end
super
end
+ alias << push
def pop(*args)
retval = super