From 4b5e5911fceb68dcc87212958ddf477bc7ee58d5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sun, 13 Sep 2009 03:16:23 +0400 Subject: [PATCH] glib: Use g_thread_get_initialized to check whether we have to call g_thread_init --- glib/glib.lisp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 1.7.10.4