20 #ifdef USE_USE_GLIB_THREADS
35 #ifdef USE_GLIB_THREADS
37 GError *threadErrorPtr;
45 #ifdef USE_GLIB_THREADS
54 #ifdef USE_GLIB_THREADS
55 g_thread_join(thread);
59 pthread_cancel(thread);
76 #ifdef USE_GLIB_THREADS
77 int run(
void (*start_routine) (
void *),
void *data) {
79 int run(
void *(*start_routine) (
void *),
void *data) {
81 #ifdef USE_GLIB_THREADS
82 thread = g_thread_create((GThreadFunc)start_routine, (gpointer) data, TRUE, &threadErrorPtr);
87 pthread_attr_init(&attr);
88 pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
91 int threadResp=pthread_create(&thread, &attr, start_routine, data);
94 perror(
"Thread::run : Thread creation failed.");
96 pthread_attr_destroy(&attr);
105 #ifdef USE_GLIB_THREADS
106 g_thread_join(thread);
111 int threadResp=pthread_join(thread, &retVal);
114 perror(
"Thread::meetThread : Couldn't meet the thread");
124 #ifndef USE_GLIB_THREADS
125 pthread_exit(retVal);