summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-05 00:15:17 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-05 00:15:17 +0000
commit0c012b1370ab6222387600fc1d281fc7856fa75d (patch)
tree9f17c1625ded7d796a9191d58cf893060deb746e
parent6e7864ffffb81118a677f544bbf08bc8b32293ec (diff)
downloadruby-0c012b1370ab6222387600fc1d281fc7856fa75d.tar.gz
ruby-0c012b1370ab6222387600fc1d281fc7856fa75d.tar.xz
ruby-0c012b1370ab6222387600fc1d281fc7856fa75d.zip
* lib/monitor.rb: revert to the previous revision.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/monitor.rb33
2 files changed, 17 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index d94b9306b..ef43528b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.
diff --git a/lib/monitor.rb b/lib/monitor.rb
index c7f610cef..5eb7bb4e0 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -130,14 +130,10 @@ module MonitorMixin
t.wakeup if t
@waiters.push(Thread.current)
- preserved_exceptions = []
- while true
- begin
- Thread.stop
- rescue Timeout
- rescue Exception => exception
- preserved_exceptions << exception
- end
+ begin
+ Thread.stop
+ rescue Timeout
+ ensure
Thread.critical = true
if timeout && timeout_thread.alive?
Thread.kill(timeout_thread)
@@ -145,17 +141,15 @@ module MonitorMixin
if @waiters.include?(Thread.current) # interrupted?
@waiters.delete(Thread.current)
end
-
- break if @monitor.mon_owner.nil? or @monitor.mon_owner == Thread.current
- @monitor.mon_waiting_queue.delete(Thread.current)
- @monitor.mon_waiting_queue.push(Thread.current)
- end
- @monitor.mon_owner = Thread.current
- @monitor.mon_count = count
- Thread.critical = false
-
- unless preserved_exceptions.empty?
- raise preserved_exceptions.first
+ while @monitor.mon_owner &&
+ @monitor.mon_owner != Thread.current
+ @monitor.mon_waiting_queue.push(Thread.current)
+ Thread.stop
+ Thread.critical = true
+ end
+ @monitor.mon_owner = Thread.current
+ @monitor.mon_count = count
+ Thread.critical = false
end
end
@@ -238,7 +232,6 @@ module MonitorMixin
def mon_enter
Thread.critical = true
while mon_owner != nil && mon_owner != Thread.current
- mon_entering_queue.delete(Thread.current)
mon_entering_queue.push(Thread.current)
Thread.stop
Thread.critical = true