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

* lib/monitor.rb (wait): ensure reentrance.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2001-04-02 04:59:43 +00:00
parent 3c0af9ca44
commit 8eeaf69e52
2 changed files with 14 additions and 11 deletions

View file

@ -1,3 +1,7 @@
Mon Apr 2 13:54:21 2001 Shugo Maeda <shugo@ruby-lang.org>
* lib/monitor.rb (wait): ensure reentrance.
Mon Apr 2 12:40:45 2001 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (media_subtype): return subtype.

View file

@ -93,21 +93,20 @@ module MonitorMixin
rescue Timeout
@waiters.delete(Thread.current)
ensure
Thread.critical = true
if timeout && timeout_thread.alive?
Thread.kill(timeout_thread)
end
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
Thread.critical = true
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
def wait_while