summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 18:35:20 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 18:35:20 +0000
commitb1bd8de6a62f7d8b37371b779ac7b152446bb01d (patch)
tree12a28a990f733e1249589bf3063901cfe93fb914
parent5115f2fba87a3725840e5ab9d0796fdc40c4e813 (diff)
merge -c 12193
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@12326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/monitor.rb21
-rw-r--r--version.h2
3 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c2420d80c1..eb2dc6f271 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 23 03:33:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/monitor.rb (ConditionVariable#wait, mon_enter, mon_exit_for_cond):
+ ensures Thread.critical to be false. [ruby-talk:248300]
+
Wed May 23 03:25:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* util.c (ruby_strtod): exponent is radix 10. [ruby-talk:248272]
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 4ed4e41222..4c146c8086 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -105,14 +105,17 @@ module MonitorMixin
return false
ensure
Thread.critical = true
- if timer && timer.alive?
- Thread.kill(timer)
+ begin
+ if timer && timer.alive?
+ Thread.kill(timer)
+ end
+ if @waiters.include?(Thread.current) # interrupted?
+ @waiters.delete(Thread.current)
+ end
+ @monitor.instance_eval {mon_enter_for_cond(count)}
+ ensure
+ Thread.critical = false
end
- if @waiters.include?(Thread.current) # interrupted?
- @waiters.delete(Thread.current)
- end
- @monitor.instance_eval {mon_enter_for_cond(count)}
- Thread.critical = false
end
end
@@ -210,6 +213,7 @@ module MonitorMixin
Thread.critical = true
mon_acquire(@mon_entering_queue)
@mon_count += 1
+ ensure
Thread.critical = false
end
@@ -299,8 +303,9 @@ module MonitorMixin
def mon_exit_for_cond
count = @mon_count
@mon_count = 0
- mon_release
return count
+ ensure
+ mon_release
end
end
diff --git a/version.h b/version.h
index 03adda4f89..f7f8c3a5ee 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-05-23"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070523
-#define RUBY_PATCHLEVEL 45
+#define RUBY_PATCHLEVEL 46
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8