diff --git a/ChangeLog b/ChangeLog index 4820275b038022..411a0689a652bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 7 18:39:31 2005 Yukihiro Matsumoto + + * lib/thread.rb: RDoc documentation from Eric Hodel + added. [ruby-core:05148] + Tue Jun 7 18:30:04 2005 Nobuyoshi Nakada * lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file. diff --git a/lib/thread.rb b/lib/thread.rb index a069c4680a5c86..42611b7fce21db 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -23,7 +23,8 @@ class ThreadError= @max @@ -382,9 +431,20 @@ def push(obj) end super end + + # + # Alias of push + # alias << push + + # + # Alias of push + # alias enq push + # + # Retrieves data from the queue and runs a waiting thread, if any. + # def pop(*args) retval = super Thread.critical = true @@ -404,20 +464,24 @@ def pop(*args) end retval end + + # + # Alias of pop + # alias shift pop + + # + # Alias of pop + # alias deq pop + # + # Returns the number of threads waiting on the queue. + # def num_waiting @waiting.size + @queue_wait.size end end # Documentation comments: -# - SizedQueue #push and #pop deserve some documentation, as they are different -# from the Queue implementations. -# - Some methods are not documented in Pickaxe/Nutshell, and are therefore not -# documented here. See FIXME notes. -# - Reference to Pickaxe page numbers should be replaced with either a section -# name or a summary. -# - How do you document aliases? # - How do you make RDoc inherit documentation from superclass?