Do not run the g_child_watch_* test multi-threaded, as that doesn't work

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.
This commit is contained in:
Sebastian Wilhelmi 2004-03-09 00:12:36 +00:00 committed by Matthias Clasen
parent 6c9d4c9e58
commit 5f487e3647
7 changed files with 50 additions and 1 deletions

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View 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> 2004-03-08 Alastair McKinstry <mckinstry@computer.org>
* configure.in: Added "ga" (Irish) to ALL_LINGUAS. * configure.in: Added "ga" (Irish) to ALL_LINGUAS.

View File

@ -104,6 +104,7 @@ child_watch_callback (GPid pid, gint status, gpointer data)
return TRUE; return TRUE;
} }
#ifdef TEST_THREAD
static gpointer static gpointer
test_thread (gpointer data) test_thread (gpointer data)
{ {
@ -126,6 +127,7 @@ test_thread (gpointer data)
return NULL; return NULL;
} }
#endif
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
@ -148,7 +150,11 @@ main (int argc, char *argv[])
* implementation is available. * implementation is available.
*/ */
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE) #if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
#ifdef TEST_THREAD
g_thread_init (NULL); g_thread_init (NULL);
#else
GPid pid;
#endif
main_loop = g_main_loop_new (NULL, FALSE); main_loop = g_main_loop_new (NULL, FALSE);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
@ -158,8 +164,15 @@ main (int argc, char *argv[])
#endif #endif
alive = 2; alive = 2;
#ifdef TEST_THREAD
g_thread_create (test_thread, GINT_TO_POINTER (10), FALSE, NULL); g_thread_create (test_thread, GINT_TO_POINTER (10), FALSE, NULL);
g_thread_create (test_thread, GINT_TO_POINTER (20), 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); g_main_loop_run (main_loop);