From: Dmitry Kalyanov Date: Sat, 12 Sep 2009 23:16:23 +0000 (+0400) Subject: glib: Use g_thread_get_initialized to check whether we have to call g_thread_init X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=4b5e5911fceb68dcc87212958ddf477bc7ee58d5;p=cl-gtk2.git glib: Use g_thread_get_initialized to check whether we have to call g_thread_init --- diff --git a/glib/glib.lisp b/glib/glib.lisp index 5999997..57c6e71 100644 --- a/glib/glib.lisp +++ b/glib/glib.lisp @@ -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