Navit SVN

/work/compile/navit/src/navit/support/glib/gthreadprivate.h

00001 /* GLIB - Library of useful routines for C programming
00002  *
00003  * gthreadprivate.h - GLib internal thread system related declarations.
00004  *
00005  *  Copyright (C) 2003 Sebastian Wilhelmi
00006  *
00007  * The Gnome Library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * The Gnome Library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
00019  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  *   Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef __G_THREADPRIVATE_H__
00024 #define __G_THREADPRIVATE_H__
00025 
00026 G_BEGIN_DECLS
00027 
00028 /* System thread identifier comparision and assignment */
00029 #if GLIB_SIZEOF_SYSTEM_THREAD == SIZEOF_VOID_P
00030 # define g_system_thread_equal_simple(thread1, thread2)                 \
00031    ((thread1).dummy_pointer == (thread2).dummy_pointer)
00032 # define g_system_thread_assign(dest, src)                              \
00033    ((dest).dummy_pointer = (src).dummy_pointer)
00034 #else /* GLIB_SIZEOF_SYSTEM_THREAD != SIZEOF_VOID_P */
00035 # define g_system_thread_equal_simple(thread1, thread2)                 \
00036    (memcmp (&(thread1), &(thread2), GLIB_SIZEOF_SYSTEM_THREAD) == 0)
00037 # define g_system_thread_assign(dest, src)                              \
00038    (memcpy (&(dest), &(src), GLIB_SIZEOF_SYSTEM_THREAD))
00039 #endif /* GLIB_SIZEOF_SYSTEM_THREAD == SIZEOF_VOID_P */
00040 
00041 #define g_system_thread_equal(thread1, thread2)                         \
00042   (g_thread_functions_for_glib_use.thread_equal ?                       \
00043    g_thread_functions_for_glib_use.thread_equal (&(thread1), &(thread2)) :\
00044    g_system_thread_equal_simple((thread1), (thread2)))
00045 
00046 /* Is called from gthread/gthread-impl.c */
00047 void g_thread_init_glib (void);
00048 
00049 /* base initializers, may only use g_mutex_new(), g_cond_new() */
00050 G_GNUC_INTERNAL void _g_mem_thread_init_noprivate_nomessage (void);
00051 /* initializers that may also use g_private_new() */
00052 G_GNUC_INTERNAL void _g_slice_thread_init_nomessage         (void);
00053 G_GNUC_INTERNAL void _g_messages_thread_init_nomessage      (void);
00054 
00055 /* full fledged initializers */
00056 G_GNUC_INTERNAL void _g_convert_thread_init (void);
00057 G_GNUC_INTERNAL void _g_rand_thread_init (void);
00058 G_GNUC_INTERNAL void _g_main_thread_init (void);
00059 G_GNUC_INTERNAL void _g_atomic_thread_init (void);
00060 G_GNUC_INTERNAL void _g_utils_thread_init (void);
00061 
00062 #ifdef G_OS_WIN32
00063 G_GNUC_INTERNAL void _g_win32_thread_init (void);
00064 #endif /* G_OS_WIN32 */
00065 
00066 G_END_DECLS
00067 
00068 #endif /* __G_THREADPRIVATE_H__ */