- File:
-
- 1 edited
-
src/libcfa/concurrency/monitor.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor.c
r4aa2fb2 rc81ebf9 56 56 else if( this->owner == thrd) { 57 57 //We already have the monitor, just not how many times we took it 58 verify( this->recursion > 0 );58 assert( this->recursion > 0 ); 59 59 this->recursion += 1; 60 60 } … … 78 78 lock( &this->lock ); 79 79 80 thread_desc * thrd = this_thread(); 81 80 82 LIB_DEBUG_PRINT_SAFE("%p Leaving %p (o: %p, r: %i)\n", thrd, this, this->owner, this->recursion); 81 verifyf( this_thread() == this->owner, "Expected owner to be %p, got %p (r: %i)", this_thread(), this->owner, this->recursion );83 assertf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i)", thrd, this->owner, this->recursion ); 82 84 83 85 //Leaving a recursion level, decrement the counter … … 165 167 //Check that everything is as expected 166 168 assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors ); 167 verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );168 verifyf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count );169 assertf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count ); 170 assertf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count ); 169 171 170 172 unsigned short count = this->monitor_count; … … 227 229 228 230 //Check that everything is as expected 229 verify( this->monitors );230 verify( this->monitor_count != 0 );231 assert( this->monitors ); 232 assert( this->monitor_count != 0 ); 231 233 232 234 unsigned short count = this->monitor_count; … … 276 278 277 279 //Check that everything is as expected 278 verifyf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );279 verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );280 assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors ); 281 assertf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count ); 280 282 281 283 unsigned short count = this->monitor_count; … … 325 327 326 328 uintptr_t front( condition * this ) { 327 verifyf( !is_empty(this), 328 "Attempt to access user data on an empty condition.\n" 329 "Possible cause is not checking if the condition is empty before reading stored data." 329 LIB_DEBUG_DO( 330 if( is_empty(this) ) { 331 abortf( "Attempt to access user data on an empty condition.\n" 332 "Possible cause is not checking if the condition is empty before reading stored data." ); 333 } 330 334 ); 331 335 return this->blocked.head->user_info; … … 487 491 488 492 void append( __condition_blocked_queue_t * this, __condition_node_t * c ) { 489 verify(this->tail != NULL);493 assert(this->tail != NULL); 490 494 *this->tail = c; 491 495 this->tail = &c->next;
Note:
See TracChangeset
for help on using the changeset viewer.