Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add pause/resume methods, pipe should not raise exception on push if …

…closed
  • Loading branch information...
commit efe54063b01dd2c177b802f7a4b79f9debd1bb7a 1 parent d896525
@slyphon slyphon authored
View
8 java/java_base.rb
@@ -435,6 +435,14 @@ def notify_connected!
@connected_latch.release
end
+ def pause_before_fork_in_parent
+ # this is a no-op in java-land
+ end
+
+ def resume_after_fork_in_parent
+ # this is a no-op in java-land
+ end
+
protected
def jzk
@mutex.synchronize { @jzk }
View
10 lib/zookeeper/client_methods.rb
@@ -192,6 +192,16 @@ def session_passwd
super
end
+ # stop all underlying threads in preparation for a fork()
+ def pause_before_fork_in_parent
+ super
+ end
+
+ # re-start all underlying threads after performing a fork()
+ def resume_after_fork_in_parent
+ super
+ end
+
protected
# used during shutdown, awaken the event delivery thread if it's blocked
# waiting for the next event
View
3  lib/zookeeper/common/queue_with_pipe.rb
@@ -33,8 +33,7 @@ def clear
def push(obj)
@mutex.lock
begin
- raise ShutdownException if (@closed or @graceful)
-
+# raise ShutdownException if (@closed or @graceful)
@array << obj
@cond.signal
ensure
Please sign in to comment.
Something went wrong with that request. Please try again.