g_system_thread_create: SystemThread -> RealThread
authorRyan Lortie <desrt@desrt.ca>
Thu, 13 Oct 2011 02:19:28 +0000 (22:19 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 13 Oct 2011 02:43:22 +0000 (22:43 -0400)
Just like g_system_thread_wait().

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

index f53f722..8345b4c 100644 (file)
@@ -1086,7 +1086,7 @@ g_system_thread_create (GThreadFunc       thread_func,
                         gpointer          arg,
                         gulong            stack_size,
                         gboolean          joinable,
-                        gpointer          thread,
+                        GRealThread      *thread,
                         GError          **error)
 {
   pthread_attr_t attr;
@@ -1111,7 +1111,7 @@ g_system_thread_create (GThreadFunc       thread_func,
   posix_check_cmd (pthread_attr_setdetachstate (&attr,
           joinable ? PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED));
 
-  ret = pthread_create (thread, &attr, (void* (*)(void*))thread_func, arg);
+  ret = pthread_create ((pthread_t *) &(thread->system_thread), &attr, (void* (*)(void*))thread_func, arg);
 
   posix_check_cmd (pthread_attr_destroy (&attr));
 
index 9988aec..5b49b61 100644 (file)
@@ -502,7 +502,7 @@ g_system_thread_create (GThreadFunc       func,
                         gpointer          data,
                         gulong            stack_size,
                         gboolean          joinable,
-                        gpointer          thread,
+                        GRealThread      *thread,
                         GError          **error)
 {
   guint ignore;
@@ -529,7 +529,7 @@ g_system_thread_create (GThreadFunc       func,
       return;
     }
 
-  *(GThreadData **)thread = retval;
+  *(GThreadData **) &(thread->system_thread) = retval;
 }
 
 void
index f13eb3a..7e0bb9b 100644 (file)
@@ -812,7 +812,7 @@ g_thread_new_internal (const gchar   *name,
   result->name = name;
   G_LOCK (g_thread_new);
   g_system_thread_create (proxy, result, stack_size, joinable,
-                          &result->system_thread, &local_error);
+                          result, &local_error);
   G_UNLOCK (g_thread_new);
 
   if (local_error)
index 72aa63c..977c29b 100644 (file)
@@ -40,7 +40,7 @@ G_GNUC_INTERNAL void     g_system_thread_create (GThreadFunc       func,
                                                  gpointer          data,
                                                  gulong            stack_size,
                                                  gboolean          joinable,
-                                                 gpointer          thread,
+                                                 GRealThread      *thread,
                                                  GError          **error);
 G_GNUC_INTERNAL
 void            g_system_thread_free            (GRealThread  *thread);