Changeset 1ab773e0


Ignore:
Timestamp:
Dec 14, 2022, 2:25:52 PM (16 months ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
26544f9, 46da46b, 93e0603
Parents:
441a6a7
Message:

more lock cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/locks.hfa

    r441a6a7 r1ab773e0  
    3838#include <unistd.h>
    3939
     40// undef to make a number of the locks not reacquire upon waking from a condlock
     41#define REACQ 1
     42
    4043//-----------------------------------------------------------------------------
    4144// Semaphore
     
    353356        // flag showing if lock is held
    354357        bool held:1;
    355 
    356         #ifdef __CFA_DEBUG__
    357         // for deadlock detection
    358         struct thread$ * owner;
    359         #endif
    360358};
    361359
     
    372370static inline void lock(fast_block_lock & this) with(this) {
    373371        lock( lock __cfaabi_dbg_ctx2 );
    374 
    375         #ifdef __CFA_DEBUG__
    376         assert(!(held && owner == active_thread()));
    377         #endif
    378372        if ( held ) {
    379373                insert_last( blocked_threads, *active_thread() );
     
    383377        }
    384378        held = true;
    385         #ifdef __CFA_DEBUG__
    386         owner = active_thread();
    387         #endif
    388379        unlock( lock );
    389380}
     
    394385        thread$ * t = &try_pop_front( blocked_threads );
    395386        held = ( t ? true : false );
    396         #ifdef __CFA_DEBUG__
    397         owner = ( t ? t : 0p );
    398         #endif
    399387        unpark( t );
    400388        unlock( lock );
     
    662650        // if internal fast_block_lock is not held
    663651        held = true;
    664         #ifdef __CFA_DEBUG__
    665         owner = t;
    666         #endif
    667652        unlock( lock );
    668653
Note: See TracChangeset for help on using the changeset viewer.