Changeset 1ab773e0 for libcfa/src/concurrency/locks.hfa
- Timestamp:
- Dec 14, 2022, 2:25:52 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 26544f9, 46da46b, 93e0603
- Parents:
- 441a6a7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
r441a6a7 r1ab773e0 38 38 #include <unistd.h> 39 39 40 // undef to make a number of the locks not reacquire upon waking from a condlock 41 #define REACQ 1 42 40 43 //----------------------------------------------------------------------------- 41 44 // Semaphore … … 353 356 // flag showing if lock is held 354 357 bool held:1; 355 356 #ifdef __CFA_DEBUG__357 // for deadlock detection358 struct thread$ * owner;359 #endif360 358 }; 361 359 … … 372 370 static inline void lock(fast_block_lock & this) with(this) { 373 371 lock( lock __cfaabi_dbg_ctx2 ); 374 375 #ifdef __CFA_DEBUG__376 assert(!(held && owner == active_thread()));377 #endif378 372 if ( held ) { 379 373 insert_last( blocked_threads, *active_thread() ); … … 383 377 } 384 378 held = true; 385 #ifdef __CFA_DEBUG__386 owner = active_thread();387 #endif388 379 unlock( lock ); 389 380 } … … 394 385 thread$ * t = &try_pop_front( blocked_threads ); 395 386 held = ( t ? true : false ); 396 #ifdef __CFA_DEBUG__397 owner = ( t ? t : 0p );398 #endif399 387 unpark( t ); 400 388 unlock( lock ); … … 662 650 // if internal fast_block_lock is not held 663 651 held = true; 664 #ifdef __CFA_DEBUG__665 owner = t;666 #endif667 652 unlock( lock ); 668 653
Note: See TracChangeset
for help on using the changeset viewer.