Ignore:
Timestamp:
Nov 19, 2021, 11:39:35 AM (9 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
enum, forall-pointer-decay, master, pthread-emulation
Children:
1757f98, c60e5094
Parents:
b14ec5f
Message:

Fix the new FD change.

File:
1 edited

Legend:

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

    rb14ec5f ra633f6f  
    268268        ready_schedule_lock();
    269269
    270         // Simple counting lock, acquired, acquired by incrementing the counter
    271         // to an odd number
    272         for() {
    273                 uint64_t l = this.lock;
    274                 if(
    275                         (0 == (l % 2))
    276                         && __atomic_compare_exchange_n(&this.lock, &l, l + 1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
    277                 ) return;
    278                 Pause();
    279         }
     270        lock( this.lock __cfaabi_dbg_ctx2 );
    280271
    281272        /* paranoid */ verify( ! __preemption_enabled() );
     
    289280        ready_schedule_lock();
    290281
    291         // Simple counting lock, acquired, acquired by incrementing the counter
    292         // to an odd number
    293         uint64_t l = this.lock;
    294         if(
    295                 (0 == (l % 2))
    296                 && __atomic_compare_exchange_n(&this.lock, &l, l + 1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
    297         ) {
     282        if(try_lock( this.lock __cfaabi_dbg_ctx2 )) {
    298283                // success
    299284                /* paranoid */ verify( ! __preemption_enabled() );
     
    311296        /* paranoid */ verify( ! __preemption_enabled() );
    312297
    313         /* paranoid */ verify( 1 == (this.lock % 2) );
    314         // Simple couting lock, release by incrementing to an even number
    315         __atomic_fetch_add( &this.lock, 1, __ATOMIC_SEQ_CST );
     298        unlock(this.lock);
    316299
    317300        // Release the global lock, which we acquired when locking
Note: See TracChangeset for help on using the changeset viewer.