From: Sebastian Wilhelmi Date: Tue, 15 Dec 1998 17:50:47 +0000 (+0000) Subject: Dont complain, if --without-threads or --with-threads=none is supplied; X-Git-Tag: GLIB_1_1_8~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d98c425676cbd0eca9580eace93a761d621af108;p=platform%2Fupstream%2Fglib.git Dont complain, if --without-threads or --with-threads=none is supplied; 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or --with-threads=none is supplied; Test for pthread_attr_init instead of pthread_cond_init, if threads seems to be supported by standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib as well. * glib.h, gmutex.c: Changed private to private_key to avoid problems when compiling with under C++. --- diff --git a/ChangeLog b/ChangeLog index 87473d8..29cf2ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 87473d8..29cf2ba 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +1998-12-15 Sebastian Wilhelmi + + * configure.in: Dont complain, if --without-threads or + --with-threads=none is supplied; Test for pthread_attr_init + instead of pthread_cond_init, if threads seems to be supported by + standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib + as well. + + * glib.h, gmutex.c: Changed private to private_key to avoid + problems when compiling with under C++. + 1998-12-15 Jeff Garzik * configure.in: diff --git a/configure.in b/configure.in index 25363b4..71b671c 100644 --- a/configure.in +++ b/configure.in @@ -564,7 +564,10 @@ if test "x$want_threads" = xyes || test "x$want_threads" = xposix; then AC_CHECK_LIB(pthreads, pthread_cond_init, have_threads=posix) fi if test "x$have_threads" = xnone; then - AC_CHECK_FUNC(pthread_cond_init, have_threads=posix) + # dont let us be fooled by a defined pthread_cond_init + # function in the standard c-lib, that doesn't have too mean, + # there is full thread support, it might be a weak symbol. + AC_CHECK_FUNC(pthread_attr_init, have_threads=posix) fi fi if test "x$want_threads" = xyes || test "x$want_threads" = xnspr; then @@ -575,7 +578,7 @@ fi AC_MSG_CHECKING(for thread implementation) -if test "x$have_threads" = xnone; then +if test "x$have_threads" = xnone && test "x$want_threads" != xno; then AC_MSG_RESULT(none available) AC_MSG_WARN($THREAD_NO_IMPLEMENTATION) else @@ -680,6 +683,8 @@ AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c") AC_SUBST(G_THREAD_CFLAGS) AC_SUBST(G_THREAD_LIBS) +CFLAGS="$CFLAGS $G_THREAD_CFLAGS" + dnl ****************************** dnl *** output the whole stuff *** dnl ****************************** diff --git a/glib.h b/glib.h index d4d1aaa..5a3020b 100644 --- a/glib.h +++ b/glib.h @@ -2620,8 +2620,8 @@ struct _GThreadFunctions GTimeVal *end_time); void (*cond_free) (GCond* cond); GPrivate* (*private_new) (GDestroyNotify destructor); - gpointer (*private_get) (GPrivate* private); - void (*private_set) (GPrivate* private, gpointer value); + gpointer (*private_get) (GPrivate* private_key); + void (*private_set) (GPrivate* private_key, gpointer value); }; GUTILS_C_VAR GThreadFunctions g_thread_functions_for_glib_use; @@ -2660,11 +2660,11 @@ GMutex* g_static_mutex_get_mutex_impl(GMutex** mutex); #define g_private_new(destructor) \ G_USE_THREAD_FUNC_UNCOND(private_new,(destructor)) -#define g_private_get(private) \ - G_USE_THREAD_FUNC(private_get,((gpointer)private),(private)) -#define g_private_set(private,value) \ - G_USE_THREAD_FUNC(private_set,(void)(private=(GPrivate *)(value)), \ - (private,value)) +#define g_private_get(private_key) \ + G_USE_THREAD_FUNC(private_get,((gpointer)private_key),(private_key)) +#define g_private_set(private_key,value) \ + G_USE_THREAD_FUNC(private_set,(void)(private_key=(GPrivate *)(value)), \ + (private_key,value)) /* GStaticMutex'es can be statically initialized with the value * G_STATIC_MUTEX_INIT, and then they can directly be used, that is @@ -2684,8 +2684,8 @@ struct _GStaticPrivate #define G_STATIC_PRIVATE_INIT { 0 } -gpointer g_static_private_get (GStaticPrivate* private); -void g_static_private_set (GStaticPrivate *private, +gpointer g_static_private_get (GStaticPrivate* private_key); +void g_static_private_set (GStaticPrivate *private_key, gpointer data, GDestroyNotify notify); diff --git a/glib/glib.h b/glib/glib.h index d4d1aaa..5a3020b 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -2620,8 +2620,8 @@ struct _GThreadFunctions GTimeVal *end_time); void (*cond_free) (GCond* cond); GPrivate* (*private_new) (GDestroyNotify destructor); - gpointer (*private_get) (GPrivate* private); - void (*private_set) (GPrivate* private, gpointer value); + gpointer (*private_get) (GPrivate* private_key); + void (*private_set) (GPrivate* private_key, gpointer value); }; GUTILS_C_VAR GThreadFunctions g_thread_functions_for_glib_use; @@ -2660,11 +2660,11 @@ GMutex* g_static_mutex_get_mutex_impl(GMutex** mutex); #define g_private_new(destructor) \ G_USE_THREAD_FUNC_UNCOND(private_new,(destructor)) -#define g_private_get(private) \ - G_USE_THREAD_FUNC(private_get,((gpointer)private),(private)) -#define g_private_set(private,value) \ - G_USE_THREAD_FUNC(private_set,(void)(private=(GPrivate *)(value)), \ - (private,value)) +#define g_private_get(private_key) \ + G_USE_THREAD_FUNC(private_get,((gpointer)private_key),(private_key)) +#define g_private_set(private_key,value) \ + G_USE_THREAD_FUNC(private_set,(void)(private_key=(GPrivate *)(value)), \ + (private_key,value)) /* GStaticMutex'es can be statically initialized with the value * G_STATIC_MUTEX_INIT, and then they can directly be used, that is @@ -2684,8 +2684,8 @@ struct _GStaticPrivate #define G_STATIC_PRIVATE_INIT { 0 } -gpointer g_static_private_get (GStaticPrivate* private); -void g_static_private_set (GStaticPrivate *private, +gpointer g_static_private_get (GStaticPrivate* private_key); +void g_static_private_set (GStaticPrivate *private_key, gpointer data, GDestroyNotify notify); diff --git a/gmutex.c b/gmutex.c index b1d8947..2716f17 100644 --- a/gmutex.c +++ b/gmutex.c @@ -104,7 +104,7 @@ g_static_mutex_get_mutex_impl (GMutex** mutex) } gpointer -g_static_private_get (GStaticPrivate *private) +g_static_private_get (GStaticPrivate *private_key) { GArray *array; @@ -112,16 +112,16 @@ g_static_private_get (GStaticPrivate *private) if (!array) return NULL; - if (!private->index) + if (!private_key->index) return NULL; - else if (private->index <= array->len) - return g_array_index (array, GStaticPrivateNode, (private->index - 1)).data; + else if (private_key->index <= array->len) + return g_array_index (array, GStaticPrivateNode, (private_key->index - 1)).data; else return NULL; } void -g_static_private_set (GStaticPrivate *private, +g_static_private_set (GStaticPrivate *private_key, gpointer data, GDestroyNotify notify) { @@ -135,21 +135,21 @@ g_static_private_set (GStaticPrivate *private, g_private_set (g_thread_specific_private, array); } - if (!private->index) + if (!private_key->index) { g_mutex_lock (g_thread_specific_mutex); - if (!private->index) - private->index = ++next_index; + if (!private_key->index) + private_key->index = ++next_index; g_mutex_unlock (g_thread_specific_mutex); } - if (private->index > array->len) - g_array_set_size (array, private->index); + if (private_key->index > array->len) + g_array_set_size (array, private_key->index); - g_array_index (array, GStaticPrivateNode, (private->index - 1)).data = data; - g_array_index (array, GStaticPrivateNode, (private->index - 1)).destroy = notify; + g_array_index (array, GStaticPrivateNode, (private_key->index - 1)).data = data; + g_array_index (array, GStaticPrivateNode, (private_key->index - 1)).destroy = notify; } static void