summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-08 19:35:07 +0000
committerseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-08 19:35:07 +0000
commit113b94e1452048cb88d512d3ab22dfa5f7c2930e (patch)
tree1c922bf7af00a65284efd8aecb4cfbbdbdf227c4
parenta089fe010e673d2579250e3f0dc41ec89b2f8d26 (diff)
* lib/rinda/ring.rb (lookup_ring_any): fix Rinda::RingFinger.primary
hungs forever. [ruby-talk:395364] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/rinda/ring.rb8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e7de9b08ed1..477a67fd9ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 9 04:31:26 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/rinda/ring.rb (lookup_ring_any): fix Rinda::RingFinger.primary
+ hungs forever. [ruby-talk:395364]
+
Tue May 8 21:09:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* include/ruby/win32.h (FD_SET): change function to macro.
diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb
index 3ff4606e2a2..8a2a201c8a5 100644
--- a/lib/rinda/ring.rb
+++ b/lib/rinda/ring.rb
@@ -203,13 +203,17 @@ module Rinda
queue.push(ts)
end
queue.push(nil)
+ end
+
+ @primary = queue.pop
+ raise('RingNotFound') if @primary.nil?
+
+ Thread.new do
while it = queue.pop
@rings.push(it)
end
end
- @primary = queue.pop
- raise('RingNotFound') if @primary.nil?
@primary
end