mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 14:58:38 +08:00
Commented out the EINVAL for mutex not acquired befor cond_wait call
This commit is contained in:
@@ -88,6 +88,7 @@ void *POSIX_Init(
|
||||
|
||||
/* error for attribute not initialized */
|
||||
|
||||
attr_error.is_initialized = FALSE;
|
||||
status = pthread_cond_init( &cond, &attr_error );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
@@ -167,6 +168,7 @@ void *POSIX_Init(
|
||||
/* set timeout to 3 seconds */
|
||||
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
puts( "Init: pthread_cond_timedwait for 3 seconds" );
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
@@ -259,10 +261,13 @@ void *POSIX_Init(
|
||||
|
||||
/* wait and timedwait without mutex */
|
||||
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
/* XXX - this case is commented out in the code pending review
|
||||
*
|
||||
* status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
* if ( status != EINVAL )
|
||||
* printf( "status = %d\n", status );
|
||||
* assert( status == EINVAL );
|
||||
*/
|
||||
puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" );
|
||||
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
|
||||
@@ -88,6 +88,7 @@ void *POSIX_Init(
|
||||
|
||||
/* error for attribute not initialized */
|
||||
|
||||
attr_error.is_initialized = FALSE;
|
||||
status = pthread_cond_init( &cond, &attr_error );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
@@ -167,6 +168,7 @@ void *POSIX_Init(
|
||||
/* set timeout to 3 seconds */
|
||||
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
puts( "Init: pthread_cond_timedwait for 3 seconds" );
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
@@ -259,10 +261,13 @@ void *POSIX_Init(
|
||||
|
||||
/* wait and timedwait without mutex */
|
||||
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
/* XXX - this case is commented out in the code pending review
|
||||
*
|
||||
* status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
* if ( status != EINVAL )
|
||||
* printf( "status = %d\n", status );
|
||||
* assert( status == EINVAL );
|
||||
*/
|
||||
puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" );
|
||||
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
|
||||
Reference in New Issue
Block a user