1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* {ext,lib,test}/**/*.rb: removed trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-03-06 03:56:38 +00:00
parent 9b52ae2e64
commit 287a34ae0d
856 changed files with 13989 additions and 13989 deletions

View file

@ -20,7 +20,7 @@ if $DEBUG
Thread.abort_on_exception = true
end
#
#
# ConditionVariable objects augment class Mutex. Using condition variables,
# it is possible to suspend while in the middle of a critical section until a
# resource becomes available.
@ -31,7 +31,7 @@ end
#
# mutex = Mutex.new
# resource = ConditionVariable.new
#
#
# a = Thread.new {
# mutex.synchronize {
# # Thread 'a' now needs the resource
@ -39,7 +39,7 @@ end
# # 'a' can now have the resource
# }
# }
#
#
# b = Thread.new {
# mutex.synchronize {
# # Thread 'b' has finished using the resource
@ -55,7 +55,7 @@ class ConditionVariable
@waiters = []
@waiters_mutex = Mutex.new
end
#
# Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
#
@ -68,7 +68,7 @@ class ConditionVariable
mutex.sleep
end
end
#
# Wakes up the first thread in line waiting for this lock.
#
@ -80,7 +80,7 @@ class ConditionVariable
retry
end
end
#
# Wakes up all threads waiting for this lock.
#
@ -106,9 +106,9 @@ end
# Example:
#
# require 'thread'
#
#
# queue = Queue.new
#
#
# producer = Thread.new do
# 5.times do |i|
# sleep rand(i) # simulate expense
@ -116,7 +116,7 @@ end
# puts "#{i} produced"
# end
# end
#
#
# consumer = Thread.new do
# 5.times do |i|
# value = queue.pop
@ -124,7 +124,7 @@ end
# puts "consumed #{value}"
# end
# end
#
#
# consumer.join
#
class Queue
@ -296,7 +296,7 @@ class SizedQueue < Queue
@queue_wait.push Thread.current
@mutex.sleep
end
@que.push obj
begin
t = @waiting.shift
@ -305,7 +305,7 @@ class SizedQueue < Queue
retry
end
}
begin
t.run if t
rescue ThreadError