From 5a2348090fa0223748723a50608fc3f285790fac Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 27 Aug 1996 15:19:33 +0000 Subject: check that we were passed a valid mutex and ignore errors from the later pthread_mutex_lock. This makes our behavior more compatible with that of FSU pthreads. --- cpukit/posix/src/cond.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpukit/posix') diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c index 4e87cf5c55..e9ff4711dc 100644 --- a/cpukit/posix/src/cond.c +++ b/cpukit/posix/src/cond.c @@ -370,6 +370,12 @@ int _POSIX_Condition_variables_Wait_support( Objects_Locations location; int status; + if ( !_POSIX_Mutex_Get( mutex, &location ) ) { + return EINVAL; + } + + _Thread_Unnest_dispatch(); + the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { case OBJECTS_ERROR: @@ -388,10 +394,12 @@ int _POSIX_Condition_variables_Wait_support( the_cond->Mutex = *mutex; status = pthread_mutex_unlock( mutex ); +/* XXX ignore this for now if ( status ) { _Thread_Enable_dispatch(); return EINVAL; } +*/ _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; -- cgit v1.2.3