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

* lib/monitor.rb: revert to the previous revision.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2003-11-05 00:15:17 +00:00
parent d193b90d54
commit d61ba0cec6
2 changed files with 17 additions and 20 deletions

View file

@ -1,3 +1,7 @@
Wed Nov 5 09:14:23 2003 Shugo Maeda <shugo@ruby-lang.org>
* lib/monitor.rb: revert to the previous revision.
Wed Nov 5 08:39:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> Wed Nov 5 08:39:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain. * lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.

View file

@ -130,14 +130,10 @@ module MonitorMixin
t.wakeup if t t.wakeup if t
@waiters.push(Thread.current) @waiters.push(Thread.current)
preserved_exceptions = [] begin
while true Thread.stop
begin rescue Timeout
Thread.stop ensure
rescue Timeout
rescue Exception => exception
preserved_exceptions << exception
end
Thread.critical = true Thread.critical = true
if timeout && timeout_thread.alive? if timeout && timeout_thread.alive?
Thread.kill(timeout_thread) Thread.kill(timeout_thread)
@ -145,17 +141,15 @@ module MonitorMixin
if @waiters.include?(Thread.current) # interrupted? if @waiters.include?(Thread.current) # interrupted?
@waiters.delete(Thread.current) @waiters.delete(Thread.current)
end end
while @monitor.mon_owner &&
break if @monitor.mon_owner.nil? or @monitor.mon_owner == Thread.current @monitor.mon_owner != Thread.current
@monitor.mon_waiting_queue.delete(Thread.current) @monitor.mon_waiting_queue.push(Thread.current)
@monitor.mon_waiting_queue.push(Thread.current) Thread.stop
end Thread.critical = true
@monitor.mon_owner = Thread.current end
@monitor.mon_count = count @monitor.mon_owner = Thread.current
Thread.critical = false @monitor.mon_count = count
Thread.critical = false
unless preserved_exceptions.empty?
raise preserved_exceptions.first
end end
end end
@ -238,7 +232,6 @@ module MonitorMixin
def mon_enter def mon_enter
Thread.critical = true Thread.critical = true
while mon_owner != nil && mon_owner != Thread.current while mon_owner != nil && mon_owner != Thread.current
mon_entering_queue.delete(Thread.current)
mon_entering_queue.push(Thread.current) mon_entering_queue.push(Thread.current)
Thread.stop Thread.stop
Thread.critical = true Thread.critical = true