Rainbows! Rack HTTP server user/dev discussion
 help / color / Atom feed
From: "Mark J. Titorenko" <mark.titorenko-82pbMkz6NcNsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
To: "rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org"
Subject: [PATCH] event_machine: join reactor_thread if it is already running rather than falling through worker_loop
Date: Fri, 11 Jan 2013 11:57:12 +0000
Message-ID: <F24725C0-EE29-4AA0-85C3-8E0A756EB9F9@gmail.com> (raw)

Prior to the application of this patch, if an EventMachine reactor_thread has already been started elsewhere before the worker_loop is entered, the worker_loop exits as a second call to EM.run does not block the current thread.

This patch causes the worker_loop thread to join the reactor_thread if it is running.



 lib/rainbows/event_machine.rb |    1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 3ecdb4f..b143b39 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -99,6 +99,7 @@ module Rainbows::EventMachine
+    EM.reactor_thread.join if EM.reactor_running?
 # :enddoc:
-- (Apple Git-31.1)

Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Do not quote signatures (like this one) or top post when replying

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 11:57 Mark J. Titorenko [this message]
     [not found] ` <F24725C0-EE29-4AA0-85C3-8E0A756EB9F9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-11 20:18   ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F24725C0-EE29-4AA0-85C3-8E0A756EB9F9@gmail.com \
    --to=mark.titorenko-82pbmkz6ncnsbiue7sb01tbpr1lh4cv8@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git