You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2014/12/25 22:05:55 UTC

[04/12] mesos git commit: Initialized EventLoop and Clock earlier.

Initialized EventLoop and Clock earlier.

Review: https://reviews.apache.org/r/29225


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/37be6031
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/37be6031
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/37be6031

Branch: refs/heads/master
Commit: 37be603106f601c6e656955ef8c903995379da9e
Parents: dd37344
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Sat Dec 20 12:02:27 2014 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Sat Dec 20 17:59:55 2014 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp | 48 ++++++++++++++++----------------
 1 file changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/37be6031/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index d3dac4c..2aeb815 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -798,6 +798,30 @@ void initialize(const string& delegate)
     }
   }
 
+  // Initialize the event loop.
+  EventLoop::initialize();
+  Clock::initialize(lambda::bind(&timedout, lambda::_1));
+
+//   ev_child_init(&child_watcher, child_exited, pid, 0);
+//   ev_child_start(loop, &cw);
+
+//   /* Install signal handler. */
+//   struct sigaction sa;
+
+//   sa.sa_handler = ev_sighandler;
+//   sigfillset (&sa.sa_mask);
+//   sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */
+//   sigaction (w->signum, &sa, 0);
+
+//   sigemptyset (&sa.sa_mask);
+//   sigaddset (&sa.sa_mask, w->signum);
+//   sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0);
+
+  pthread_t thread; // For now, not saving handles on our threads.
+  if (pthread_create(&thread, NULL, &EventLoop::run, NULL) != 0) {
+    LOG(FATAL) << "Failed to initialize, pthread_create";
+  }
+
   __node__.ip = 0;
   __node__.port = 0;
 
@@ -866,30 +890,6 @@ void initialize(const string& delegate)
     PLOG(FATAL) << "Failed to initialize: " << listen.error();
   }
 
-  // Initialize the event loop.
-  EventLoop::initialize();
-  Clock::initialize(lambda::bind(&timedout, lambda::_1));
-
-//   ev_child_init(&child_watcher, child_exited, pid, 0);
-//   ev_child_start(loop, &cw);
-
-//   /* Install signal handler. */
-//   struct sigaction sa;
-
-//   sa.sa_handler = ev_sighandler;
-//   sigfillset (&sa.sa_mask);
-//   sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */
-//   sigaction (w->signum, &sa, 0);
-
-//   sigemptyset (&sa.sa_mask);
-//   sigaddset (&sa.sa_mask, w->signum);
-//   sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0);
-
-  pthread_t thread; // For now, not saving handles on our threads.
-  if (pthread_create(&thread, NULL, &EventLoop::run, NULL) != 0) {
-    LOG(FATAL) << "Failed to initialize, pthread_create";
-  }
-
   // Need to set initialzing here so that we can actually invoke
   // 'spawn' below for the garbage collector.
   initializing = false;