- pthread_cond_t impl;
-};
-
-#endif
-
-typedef struct _GThreadFunctions GThreadFunctions;
-struct _GThreadFunctions
-{
- GMutex* (*mutex_new) (void);
- void (*mutex_lock) (GMutex *mutex);
- gboolean (*mutex_trylock) (GMutex *mutex);
- void (*mutex_unlock) (GMutex *mutex);
- void (*mutex_free) (GMutex *mutex);
- GCond* (*cond_new) (void);
- void (*cond_signal) (GCond *cond);
- void (*cond_broadcast) (GCond *cond);
- void (*cond_wait) (GCond *cond,
- GMutex *mutex);
- gboolean (*cond_timed_wait) (GCond *cond,
- GMutex *mutex,
- GTimeVal *end_time);
- void (*cond_free) (GCond *cond);
- GPrivate* (*private_new) (GDestroyNotify destructor);
- gpointer (*private_get) (GPrivate *private_key);
- void (*private_set) (GPrivate *private_key,
- gpointer data);
- void (*thread_create) (GThreadFunc func,
- gpointer data,
- gulong stack_size,
- gboolean joinable,
- gboolean bound,
- GThreadPriority priority,
- gpointer thread,
- GError **error);
- void (*thread_yield) (void);
- void (*thread_join) (gpointer thread);
- void (*thread_exit) (void);
- void (*thread_set_priority)(gpointer thread,
- GThreadPriority priority);
- void (*thread_self) (gpointer thread);
- gboolean (*thread_equal) (gpointer thread1,
- gpointer thread2);
-};
-
-GLIB_VAR GThreadFunctions g_thread_functions_for_glib_use;
-GLIB_VAR gboolean g_thread_use_default_impl;
-GLIB_VAR gboolean g_threads_got_initialized;
-
-#ifndef G_DISABLE_DEPRECATED
-GLIB_VAR guint64 (*g_thread_gettime) (void);
-#endif
-
-/* initializes the mutex/cond/private implementation for glib, might
- * only be called once, and must not be called directly or indirectly
- * from another glib-function, e.g. as a callback.
- */
-void g_thread_init (GThreadFunctions *vtable);
-
-/* Checks if thread support is initialized. Identical to the
- * g_thread_supported macro but provided for language bindings.
- */
-gboolean g_thread_get_initialized (void);
-
-/* internal function for fallback static mutex implementation */
-GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
-
-#if defined(G_THREADS_MANDATORY)
-#define g_thread_supported() 1
-#else
-#define g_thread_supported() (g_threads_got_initialized)
-#endif
-
-#ifndef G_DISABLE_DEPRECATED
-GThread* g_thread_create_full (GThreadFunc func,
- gpointer data,
- gulong stack_size,
- gboolean joinable,
- gboolean bound,
- GThreadPriority priority,
- GError **error);
-#endif
-
-GThread * g_thread_create (GThreadFunc func,
- gpointer data,
- gboolean joinable,
- GError **error);
-
-GThread * g_thread_create_with_stack_size (GThreadFunc func,
- gpointer data,
- gboolean joinable,
- gsize stack_size,
- GError **error);
-
-GThread* g_thread_self (void);
-void g_thread_exit (gpointer retval);
-gpointer g_thread_join (GThread *thread);
-void g_thread_yield (void);
-
-#ifndef G_DISABLE_DEPRECATED
-void g_thread_set_priority (GThread *thread,
- GThreadPriority priority);
-#endif
-
-#ifdef G_OS_WIN32
-typedef GMutex * GStaticMutex;
-#define G_STATIC_MUTEX_INIT NULL
-#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl
-#else /* G_OS_WIN32 */
-typedef struct {
- struct _GMutex *unused;
- GMutex mutex;
-} GStaticMutex;
-#define G_STATIC_MUTEX_INIT { NULL, G_MUTEX_INIT }
-#define g_static_mutex_get_mutex(s) (&(s)->mutex)
-#endif /* G_OS_WIN32 */
-
-#define g_static_mutex_lock(mutex) \
- g_mutex_lock (g_static_mutex_get_mutex (mutex))
-#define g_static_mutex_trylock(mutex) \
- g_mutex_trylock (g_static_mutex_get_mutex (mutex))
-#define g_static_mutex_unlock(mutex) \
- g_mutex_unlock (g_static_mutex_get_mutex (mutex))
-void g_static_mutex_init (GStaticMutex *mutex);
-void g_static_mutex_free (GStaticMutex *mutex);
-
-struct _GStaticPrivate
-{