5 intptr_t crash_other_thread = 0;
6 #define CRASHING_THREAD 19
8 gboolean crasher(gpointer data)
16 intptr_t threadnum = (intptr_t)arg;
17 if (crash_other_thread && threadnum == CRASHING_THREAD)
26 GMainLoop *loop = g_main_loop_new(NULL, FALSE);
28 crash_other_thread = argc > 1;
30 if (!crash_other_thread)
32 GSource *idle_source = g_idle_source_new();
33 g_source_set_callback(idle_source, crasher, NULL, NULL);
34 g_source_attach(idle_source, g_main_context_ref_thread_default());
40 for (i = 0; i <= CRASHING_THREAD; i++)
41 pthread_create(&t, NULL, fun, (void *)i);
43 g_main_loop_run(loop);