summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 18:35:57 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 18:35:57 +0000
commit27b64608e56d45f68a38ac3ff8034f4b385196ca (patch)
tree598419004f9eede7e0ca429e4a2e711b6776675a
parent604de6cf032f2c881e9126a3f03adafd7d2e88d6 (diff)
merge -c 12193
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12327 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 872a84c..3ab31ba 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 4ed4e41..4c146c8 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 eb5e02a..06b1d6f 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-05-23"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070523
-#define RUBY_PATCHLEVEL 16
+#define RUBY_PATCHLEVEL 17
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8