Changeset ead8c7e for src/libcfa
- Timestamp:
- Feb 23, 2017, 4:30:42 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 24cde55, 51f3798
- Parents:
- 3bb51e1
- Location:
- src/libcfa/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel.c
r3bb51e1 read8c7e 456 456 457 457 void append( simple_thread_list * this, thread * t ) { 458 assert( t->next == NULL );459 458 assert(this->tail != NULL); 460 459 *this->tail = t; 461 460 this->tail = &t->next; 462 assert(this->tail != NULL);463 461 } 464 462 465 463 thread * pop_head( simple_thread_list * this ) { 466 assert(this->tail != NULL);467 464 thread * head = this->head; 468 465 if( head ) { … … 473 470 head->next = NULL; 474 471 } 475 assert(this->tail != NULL);476 472 return head; 477 473 } -
src/libcfa/concurrency/monitor.c
r3bb51e1 read8c7e 23 23 thread * thrd = this_thread(); 24 24 25 assert( this->entry_queue.tail != NULL );26 27 25 if( this->holder ) { 28 26 append( &this->entry_queue, thrd ); … … 34 32 } 35 33 36 assert( this->entry_queue.tail != NULL );37 38 34 unlock( &this->lock ); 39 35 } … … 42 38 lock( &this->lock ); 43 39 44 assert( this->entry_queue.tail != NULL );45 46 40 thread * thrd = this_thread(); 47 41 assert( thrd == this->holder ); … … 49 43 this->holder = pop_head( &this->entry_queue ); 50 44 51 assert( this->entry_queue.tail != NULL );52 53 45 unlock( &this->lock ); 54 46 if( this->holder ) ScheduleThread( this->holder );
Note: See TracChangeset
for help on using the changeset viewer.