summaryrefslogtreecommitdiff
path: root/lib/monitor.rb
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-18 04:56:22 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-18 04:56:22 +0000
commit7be5169804ee0cfe1991903fa10c31f8bd6525bd (patch)
tree0b8129f5a0b2fc9a19d6b12ae5eb966b7a6e2128 /lib/monitor.rb
parent47349e870111b8ae88bd1331559a022be88d80ec (diff)
downloadbundler-7be5169804ee0cfe1991903fa10c31f8bd6525bd.tar.gz
* lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count
just in case the previous owner thread dies without mon_exit. [fix GH-874] Patch by @chrisberkhout git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/monitor.rb')
-rw-r--r--lib/monitor.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 07394b5900..e0491ec054 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -170,6 +170,7 @@ module MonitorMixin
return false
end
@mon_owner = Thread.current
+ @mon_count = 0
end
@mon_count += 1
return true
@@ -184,6 +185,7 @@ module MonitorMixin
if @mon_owner != Thread.current
@mon_mutex.lock
@mon_owner = Thread.current
+ @mon_count = 0
end
@mon_count += 1
end