From 8b63644aabc2754aee20815b52e121b38dda9d3e Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Wed, 31 Mar 1999 09:28:59 +0000 Subject: [PATCH] Use the right default arguments for the construction of mutexes and conds 1999-03-31 Sebastian Wilhelmi * gthread/gthread-posix.c: Use the right default arguments for the construction of mutexes and conds for dce threads, these are &pthread_(cond|mutex)attr_default instead of NULL. Hint from D. Emilio Grimaldo Tunon . --- gthread/ChangeLog | 7 +++++++ gthread/gthread-posix.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gthread/ChangeLog b/gthread/ChangeLog index 712398966..f0592f344 100644 --- a/gthread/ChangeLog +++ b/gthread/ChangeLog @@ -1,3 +1,10 @@ +1999-03-31 Sebastian Wilhelmi + + * gthread-posix.c: Use the right default arguments for the + construction of mutexes and conds for dce threads, these are + &pthread_(cond|mutex)attr_default instead of NULL. Hint from + D. Emilio Grimaldo Tunon . + 1999-03-18 Sebastian Wilhelmi * Makefile.am (INCLUDES): Added @GTHREAD_COMPILE_IMPL_DEFINES@. diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c index 210b906e7..5611f87a0 100644 --- a/gthread/gthread-posix.c +++ b/gthread/gthread-posix.c @@ -48,10 +48,14 @@ int error = (what); \ if( error ) { posix_print_error( what, error ); } \ }G_STMT_END +# define mutexattr_default NULL +# define condattr_default NULL #elif defined(G_THREADS_IMPL_DCE) # define posix_check_for_error( what ) G_STMT_START{ \ if( (what) == -1 ) { posix_print_error( what, errno ); } \ }G_STMT_END +# define mutexattr_default (&pthread_mutexattr_default) +# define condattr_default (&pthread_condattr_default) #else /* neither G_THREADS_IMPL_POSIX nor G_THREADS_IMPL_DCE are defined */ # error This should not happen. Contact the GLb team. #endif @@ -60,7 +64,8 @@ static GMutex * g_mutex_new_posix_impl (void) { GMutex *result = (GMutex *) g_new (pthread_mutex_t, 1); - posix_check_for_error (pthread_mutex_init ((pthread_mutex_t *) result, NULL)); + posix_check_for_error (pthread_mutex_init ((pthread_mutex_t *) result, + mutexattr_default)); return result; } @@ -101,7 +106,8 @@ static GCond * g_cond_new_posix_impl (void) { GCond *result = (GCond *) g_new (pthread_cond_t, 1); - posix_check_for_error (pthread_cond_init ((pthread_cond_t *) result, NULL)); + posix_check_for_error (pthread_cond_init ((pthread_cond_t *) result, + condattr_default)); return result; }