Changeset 46bbcaf


Ignore:
Timestamp:
Jan 20, 2022, 11:14:18 AM (7 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
enum, forall-pointer-decay, master, pthread-emulation
Children:
753fb978
Parents:
1e8b4b49
Message:

Fix race condition in verify

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r1e8b4b49 r46bbcaf  
    219219
    220220        // Step 2 : acquire our local lock
     221        /*paranoid*/ verify(!kernelTLS().sched_lock);
    221222        __atomic_acquire( &kernelTLS().sched_lock );
    222223        /*paranoid*/ verify(kernelTLS().sched_lock);
  • libcfa/src/concurrency/ready_queue.cfa

    r1e8b4b49 r46bbcaf  
    201201uint_fast32_t ready_mutate_lock( void ) with(*__scheduler_lock) {
    202202        /* paranoid */ verify( ! __preemption_enabled() );
    203         /* paranoid */ verify( ! kernelTLS().sched_lock );
    204203
    205204        // Step 1 : lock global lock
     
    207206        //   to simply lock their own lock and enter.
    208207        __atomic_acquire( &write_lock );
     208
     209        // Make sure we won't deadlock ourself
     210        // Checking before acquiring the writer lock isn't safe
     211        // because someone else could have locked us.
     212        /* paranoid */ verify( ! kernelTLS().sched_lock );
    209213
    210214        // Step 2 : lock per-proc lock
Note: See TracChangeset for help on using the changeset viewer.