Ignore:
Timestamp:
Mar 29, 2022, 3:19:53 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
dfd3410
Parents:
72ba508
Message:

Tentative fix for termination deadlock.
Other minor improvements and checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    r72ba508 r010636f  
    635635
    636636                        // We can proceed to the fast path
    637                         if( !__alloc(ctx, &idx, 1) ) return false;
     637                        if( !__alloc(ctx, &idx, 1) ) {
     638                                /* paranoid */ verify( false ); // for now check if this happens, next time just abort the sleep.
     639                                return false;
     640                        }
    638641
    639642                        // Allocation was successful
     
    665668
    666669                        /* paranoid */ verify( sqe->user_data == (uintptr_t)&future );
    667                         __submit( ctx, &idx, 1, true );
     670                        __submit_only( ctx, &idx, 1 );
    668671
    669672                        /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
     
    690693                        }
    691694
    692                         __ioarbiter_flush( *proc->io.ctx );
    693                         ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
     695                        if( !__atomic_load_n( &proc->do_terminate, __ATOMIC_SEQ_CST ) ) {
     696                                __ioarbiter_flush( *proc->io.ctx );
     697                                ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
     698                        }
    694699
    695700                        ready_schedule_lock();
Note: See TracChangeset for help on using the changeset viewer.