Skip to content

Commit

Permalink
correct reactor_running? to return false after a process running a re…
Browse files Browse the repository at this point in the history
…actor forked
  • Loading branch information
SamSaffron committed Jul 25, 2013
1 parent dd675e4 commit 10deb49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/eventmachine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def self.run blk=nil, tail=nil, &block
# will start without release_machine being called and will immediately throw

#
if reactor_running? and @reactor_pid != Process.pid
if @reactor_running and @reactor_pid != Process.pid
# Reactor was started in a different parent, meaning we have forked.
# Clean up reactor state so a new reactor boots up in this child.
stop_event_loop
Expand Down Expand Up @@ -1181,7 +1181,7 @@ def self.popen cmd, handler=nil, *args
#
# @return [Boolean] true if the EventMachine reactor loop is currently running
def self.reactor_running?
(@reactor_running || false)
@reactor_running && Process.pid == @reactor_pid
end


Expand Down

0 comments on commit 10deb49

Please sign in to comment.