g_system_thread_join: take GRealThread *
authorRyan Lortie <desrt@desrt.ca>
Thu, 13 Oct 2011 02:14:38 +0000 (22:14 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 13 Oct 2011 02:14:38 +0000 (22:14 -0400)
Make g_system_thread_join take the GRealThread* instead of a
GSystemThread.

glib/gthread-posix.c
glib/gthread-win32.c
glib/gthread.c
glib/gthreadprivate.h

index ebeb966..7e86e38 100644 (file)
@@ -1140,10 +1140,10 @@ g_thread_yield (void)
 }
 
 void
-g_system_thread_join (gpointer thread)
+g_system_thread_join (GRealThread *thread)
 {
   gpointer ignore;
-  posix_check_cmd (pthread_join (*(pthread_t*)thread, &ignore));
+  posix_check_cmd (pthread_join (*(pthread_t*)&(thread->system_thread), &ignore));
 }
 
 void
index 8d19739..02d37ad 100644 (file)
@@ -539,9 +539,9 @@ g_thread_yield (void)
 }
 
 void
-g_system_thread_join (gpointer thread)
+g_system_thread_join (GRealThread *thread)
 {
-  GThreadData *target = *(GThreadData **)thread;
+  GThreadData *target = *(GThreadData **)&(thread->system_thread);
 
   g_return_if_fail (target->joinable);
 
index a9fe4b6..30784c3 100644 (file)
@@ -883,7 +883,7 @@ g_thread_join (GThread *thread)
   g_return_val_if_fail (thread, NULL);
   g_return_val_if_fail (thread->joinable, NULL);
 
-  g_system_thread_join (&real->system_thread);
+  g_system_thread_join (real);
 
   retval = real->retval;
 
index 6109060..1c0756b 100644 (file)
@@ -31,7 +31,8 @@ G_BEGIN_DECLS
 
 typedef struct _GRealThread GRealThread;
 
-G_GNUC_INTERNAL void     g_system_thread_join  (gpointer thread);
+G_GNUC_INTERNAL
+void            g_system_thread_join            (GRealThread      *thread);
 
 G_GNUC_INTERNAL
 GRealThread *   g_system_thread_new             (void);