Changeset 76f03c6 in rtems for cpukit/posix/src/cond.c
- Timestamp:
- 08/13/96 19:03:29 (26 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c9c94387
- Parents:
- b2e8026
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/src/cond.c
rb2e8026 r76f03c6 201 201 the_cond->process_shared = the_attr->process_shared; 202 202 203 the_cond->Mutex = (unsigned32) NULL;203 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 204 204 205 205 /* XXX some more initialization might need to go here */ … … 317 317 the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); 318 318 if ( !the_thread ) 319 the_cond->Mutex = (unsigned32) NULL;319 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 320 320 } while ( is_broadcast && the_thread ); 321 322 _Thread_Enable_dispatch(); 323 321 324 return 0; 322 325 } … … 376 379 case OBJECTS_LOCAL: 377 380 378 if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) 381 if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 382 _Thread_Enable_dispatch(); 379 383 return EINVAL; 384 } 385 386 the_cond->Mutex = *mutex; 380 387 381 388 status = pthread_mutex_unlock( mutex ); 382 if ( status ) 389 if ( status ) { 390 _Thread_Enable_dispatch(); 383 391 return status; 384 385 the_cond->Mutex = *mutex; 392 } 386 393 387 394 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); 388 389 _Thread_queue_Enqueue( &the_cond->Wait_queue, 0 ); 395 _Thread_Executing->Wait.return_code = 0; 396 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 397 _Thread_Executing->Wait.id = *cond; 398 399 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 390 400 391 401 _Thread_Enable_dispatch(); 402 403 /* 404 * Switch ourself out because we blocked as a result of the 405 * _Thread_queue_Enqueue. 406 */ 407 408 if ( _Thread_Executing->Wait.return_code ) 409 return _Thread_Executing->Wait.return_code; 392 410 393 411 status = pthread_mutex_lock( mutex );
Note: See TracChangeset
for help on using the changeset viewer.