Changeset 848439f
- Timestamp:
- Oct 7, 2020, 4:39:16 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 391c065, 41b8ea4
- Parents:
- c76bd34
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.cfa
rc76bd34 r848439f 77 77 if ( owner == kernelTLS.this_thread && !multi_acquisition) { 78 78 fprintf(stderr, "A single acquisition lock holder attempted to reacquire the lock resulting in a deadlock."); // Possibly throw instead 79 79 exit(EXIT_FAILURE); 80 80 } else if ( owner != 0p && owner != kernelTLS.this_thread ) { 81 81 append( blocked_threads, kernelTLS.this_thread ); … … 111 111 lock( lock __cfaabi_dbg_ctx2 ); 112 112 if ( owner == 0p ){ // no owner implies lock isn't held 113 fprintf( stderr, "There was an attempt to release a lock that isn't held" ); 113 fprintf( stderr, "There was an attempt to release a lock that isn't held" ); 114 114 return; 115 115 } else if ( strict_owner && owner != kernelTLS.this_thread ) { 116 fprintf( stderr, "A thread other than the owner attempted to release an owner lock" ); 116 fprintf( stderr, "A thread other than the owner attempted to release an owner lock" ); 117 117 return; 118 118 } … … 158 158 lock( lock __cfaabi_dbg_ctx2 ); 159 159 if ( owner == 0p ){ // no owner implies lock isn't held 160 fprintf( stderr, "A lock that is not held was passed to a synchronization lock" ); 160 fprintf( stderr, "A lock that is not held was passed to a synchronization lock" ); 161 161 } else if ( strict_owner && owner != kernelTLS.this_thread ) { 162 fprintf( stderr, "A thread other than the owner of a lock passed it to a synchronization lock" ); 162 fprintf( stderr, "A thread other than the owner of a lock passed it to a synchronization lock" ); 163 163 } else { 164 164 $thread * thrd = pop_head( blocked_threads ); … … 264 264 info_thread(L) * popped = pop_head( blocked_threads ); 265 265 if(popped != 0p) { 266 if( reacquire_after_signal ){ 266 if( reacquire_after_signal ){ 267 267 add_(*popped->lock, popped->t); 268 268 } else { … … 282 282 info_thread(L) * popped = pop_head( blocked_threads ); 283 283 if(popped != 0p){ 284 if( reacquire_after_signal ){ 284 if( reacquire_after_signal ){ 285 285 add_(*popped->lock, popped->t); 286 286 } else { … … 332 332 } 333 333 334 bool wait( synchronization_lock(L) & this, uintptr_t info, Duration duration ) with(this) { 334 bool wait( synchronization_lock(L) & this, uintptr_t info, Duration duration ) with(this) { 335 335 // TODO: ADD INFO 336 336 return wait( this, duration ); … … 368 368 queue_info_thread_unlock( this, l, i ); 369 369 } 370 370 371 371 bool wait( synchronization_lock(L) & this, L & l, Duration duration ) with(this) { 372 372 timeval tv = { time(0) }; … … 374 374 return wait( this, l, t + duration ); 375 375 } 376 376 377 377 bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Duration duration ) with(this) { 378 378 // TODO: ADD INFO 379 379 return wait( this, l, duration ); 380 380 } 381 381 382 382 bool wait( synchronization_lock(L) & this, L & l, Time time ) with(this) { 383 383 return false; //default 384 384 } 385 385 386 386 bool wait( synchronization_lock(L) & this, L & l, uintptr_t info, Time time ) with(this) { 387 387 // TODO: ADD INFO
Note: See TracChangeset
for help on using the changeset viewer.