LRN: Don't wait for parent control handler to quit
authorChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 20:35:48 +0000 (20:35 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 20:35:48 +0000 (20:35 +0000)
CG: Note: this should not stand; temporary hack.

src/include/gnunet_os_lib.h
src/util/os_priority.c
src/util/scheduler.c

index 715061161b4714b238642e1e4fb6dd5dc5e73baf..328f20c3594bd6995757fe8829fbd43ad8bbdf46 100644 (file)
@@ -339,6 +339,13 @@ GNUNET_OS_install_parent_control_handler (void *cls,
                                           const struct
                                           GNUNET_SCHEDULER_TaskContext * tc);
 
+/**
+ * Called everty time the parent process sends a signal
+ */
+void
+parent_control_handler (void *cls,
+                       const struct
+                       GNUNET_SCHEDULER_TaskContext * tc);
 
 /**
  * Check whether an executable exists and possibly
index d214372d7c853a3b46eca63c9804d042ee867db3..c9458212ee2b96c5dbd6ab3275b4b77142c77a0f 100644 (file)
@@ -51,7 +51,7 @@ static struct GNUNET_OS_Process current_process;
  * @param cls the 'struct GNUNET_DISK_FileHandle' of the control pipe
  * @param tc scheduler context
  */
-static void
+void
 parent_control_handler (void *cls,
                        const struct
                        GNUNET_SCHEDULER_TaskContext * tc)
index 1e9290adf4ed5233b47a913f1501b45c2d35df7e..eaf96589458372d198e4330e5f6ce806af255b93 100644 (file)
@@ -751,7 +751,11 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
 #endif
   last_tr = 0;
   busy_wait_warning = 0;
-  while ((pending != NULL) ||
+  while ((pending != NULL
+#if ENABLE_WINDOWS_WORKAROUNDS
+          && (pending->callback != parent_control_handler || pending->next != NULL)
+#endif
+         ) ||
         (pending_timeout != NULL) ||
         (ready_count > 0))
     {