Do not run the g_child_watch_* test multi-threaded, as that doesn't work
authorSebastian Wilhelmi <seppi@seppi.de>
Tue, 9 Mar 2004 00:12:36 +0000 (00:12 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 9 Mar 2004 00:12:36 +0000 (00:12 +0000)
2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>

* tests/child-test.c: Do not run the g_child_watch_* test
multi-threaded, as that doesn't work on linux prior 2.6. Fixes
#136539.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/child-test.c

index 9825ee0..e57eecb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index 9825ee0..e57eecb 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index 9825ee0..e57eecb 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index 9825ee0..e57eecb 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index 9825ee0..e57eecb 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index 9825ee0..e57eecb 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>
+
+       * tests/child-test.c: Do not run the g_child_watch_* test
+       multi-threaded, as that doesn't work on linux prior 2.6. Fixes
+       #136539.
+
 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
 
        * configure.in: Added "ga" (Irish) to ALL_LINGUAS.
index e7d7daf..37296b4 100644 (file)
@@ -104,6 +104,7 @@ child_watch_callback (GPid pid, gint status, gpointer data)
   return TRUE;
 }
 
+#ifdef TEST_THREAD
 static gpointer
 test_thread (gpointer data)
 {
@@ -126,6 +127,7 @@ test_thread (gpointer data)
 
   return NULL;
 }
+#endif
 
 int
 main (int argc, char *argv[])
@@ -148,7 +150,11 @@ main (int argc, char *argv[])
    * implementation is available.
    */
 #if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
-   g_thread_init (NULL);
+#ifdef TEST_THREAD
+  g_thread_init (NULL);
+#else
+  GPid pid;
+#endif
   main_loop = g_main_loop_new (NULL, FALSE);
 
 #ifdef G_OS_WIN32
@@ -158,8 +164,15 @@ main (int argc, char *argv[])
 #endif
 
   alive = 2;
+#ifdef TEST_THREAD
   g_thread_create (test_thread, GINT_TO_POINTER (10), FALSE, NULL);
   g_thread_create (test_thread, GINT_TO_POINTER (20), FALSE, NULL);
+#else
+  pid = get_a_child (10);
+  g_child_watch_add (pid, child_watch_callback, GINT_TO_POINTER (10));
+  pid = get_a_child (20);
+  g_child_watch_add (pid, child_watch_callback, GINT_TO_POINTER (20));
+#endif
   
   g_main_loop_run (main_loop);