glib: Use g_thread_get_initialized to check whether we have to call g_thread_init
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 12 Sep 2009 23:16:23 +0000 (03:16 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 12 Sep 2009 23:16:23 +0000 (03:16 +0400)
glib/glib.lisp

index 5999997..57c6e71 100644 (file)
@@ -401,12 +401,11 @@ Adds a function to be called whenever there are no higher priority events pendin
 (defcfun (g-thread-init "g_thread_init") :void
   (vtable :pointer))
 
-(defvar *threads-initialized-p* nil)
+(defcfun g-thread-get-initialized :boolean)
 
 (at-init ()
-  (unless *threads-initialized-p*
-    (g-thread-init (null-pointer))
-    (setf *threads-initialized-p* t)))
+  (unless (g-thread-get-initialized)
+    (g-thread-init (null-pointer))))
 
 (defcenum g-thread-priority
   :g-thread-priority-low