static gpointer run_thread (GTest * test) { gint i = 1; while (!stopping) { my_test_do_property (test); if ((i++ % 10000) == 0) { g_print (".%c", 'a' + test->id); g_thread_yield(); /* force context switch */ } } return NULL; }
int main (int argc, char **argv) { gint i; GTest *test; g_print ("START: %s\n", argv[0]); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK)); g_type_init (); test = g_object_new (G_TYPE_TEST, NULL); g_signal_connect (test, "notify::dummy", G_CALLBACK (dummy_notify), NULL); g_assert (count == test->dummy); for (i=0; i<1000000; i++) { my_test_do_property (test); } g_assert (count == test->dummy); return 0; }