Use the right default arguments for the construction of mutexes and conds

1999-03-31  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* 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 <emilio_tunon@nl.compuware.com>.
This commit is contained in:
Sebastian Wilhelmi 1999-03-31 09:28:59 +00:00 committed by Sebastian Wilhelmi
parent 0ca3f612e7
commit 8b63644aab
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,10 @@
1999-03-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <emilio_tunon@nl.compuware.com>.
1999-03-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 1999-03-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* Makefile.am (INCLUDES): Added @GTHREAD_COMPILE_IMPL_DEFINES@. * Makefile.am (INCLUDES): Added @GTHREAD_COMPILE_IMPL_DEFINES@.

View File

@ -48,10 +48,14 @@
int error = (what); \ int error = (what); \
if( error ) { posix_print_error( what, error ); } \ if( error ) { posix_print_error( what, error ); } \
}G_STMT_END }G_STMT_END
# define mutexattr_default NULL
# define condattr_default NULL
#elif defined(G_THREADS_IMPL_DCE) #elif defined(G_THREADS_IMPL_DCE)
# define posix_check_for_error( what ) G_STMT_START{ \ # define posix_check_for_error( what ) G_STMT_START{ \
if( (what) == -1 ) { posix_print_error( what, errno ); } \ if( (what) == -1 ) { posix_print_error( what, errno ); } \
}G_STMT_END }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 */ #else /* neither G_THREADS_IMPL_POSIX nor G_THREADS_IMPL_DCE are defined */
# error This should not happen. Contact the GLb team. # error This should not happen. Contact the GLb team.
#endif #endif
@ -60,7 +64,8 @@ static GMutex *
g_mutex_new_posix_impl (void) g_mutex_new_posix_impl (void)
{ {
GMutex *result = (GMutex *) g_new (pthread_mutex_t, 1); 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; return result;
} }
@ -101,7 +106,8 @@ static GCond *
g_cond_new_posix_impl (void) g_cond_new_posix_impl (void)
{ {
GCond *result = (GCond *) g_new (pthread_cond_t, 1); 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; return result;
} }