Update VS 2008/2010 property sheets
[platform/upstream/glib.git] / gthread / gthread-impl.c
index d8f26d4..b483657 100644 (file)
@@ -105,7 +105,7 @@ g_mutex_lock_errorcheck_impl (GMutex *mutex,
   g_thread_functions_for_glib_use.thread_self (&self);
 
   if (g_system_thread_equal (info->owner, self))
-    g_error ("Trying to recursivly lock a mutex at '%s', "
+    g_error ("Trying to recursively lock a mutex at '%s', "
             "previously locked at '%s'",
             loc, info->location);
 
@@ -294,7 +294,12 @@ g_thread_init (GThreadFunctions* init)
   gboolean supported;
 
   if (thread_system_already_initialized)
-    g_error ("GThread system may only be initialized once.");
+    {
+      if (init != NULL)
+       g_warning ("GThread system already initialized, ignoring custom thread implementation.");
+
+      return;
+    }
 
   thread_system_already_initialized = TRUE;
 
@@ -312,6 +317,8 @@ g_thread_init (GThreadFunctions* init)
     g_thread_use_default_impl = FALSE;
 
   g_thread_functions_for_glib_use = *init;
+  if (g_thread_gettime_impl)
+    g_thread_gettime = g_thread_gettime_impl;
 
   supported = (init->mutex_new &&
               init->mutex_lock &&
@@ -332,8 +339,7 @@ g_thread_init (GThreadFunctions* init)
               init->thread_join &&
               init->thread_exit &&
               init->thread_set_priority &&
-              init->thread_self &&
-               init->gettime);
+              init->thread_self);
 
   /* if somebody is calling g_thread_init (), it means that he wants to
    * have thread support, so check this
@@ -362,4 +368,10 @@ g_thread_init (GThreadFunctions* init)
   g_error ("GLib thread support is disabled.");
 }
 
+void
+g_thread_init_with_errorcheck_mutexes (GThreadFunctions* init)
+{
+  g_error ("GLib thread support is disabled.");
+}
+
 #endif /* !G_THREADS_ENABLED */