Ignore:
Timestamp:
Jun 2, 2021, 5:22:57 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
96bfdde7, e014c6d
Parents:
e9ea53d
Message:

Attempt to fix the stack checker for when coroutines are interrupted at the wrong moment

File:
1 edited

Legend:

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

    re9ea53d rab5baab  
    8686        src->state = src->state == Halted ? Halted : Blocked;
    8787
     88        // get the active thread once
     89        $thread * athrd = active_thread();
     90
     91        // Mark the coroutine
     92        /* paranoid */ verify( !athrd->corctx_flag );
     93        athrd->corctx_flag = true;
     94
    8895        // set new coroutine that task is executing
    89         active_thread()->curr_cor = dst;
     96        athrd->curr_cor = dst;
    9097
    9198        // context switch to specified coroutine
    92         verify( dst->context.SP );
     99        /* paranoid */ verify( dst->context.SP );
    93100        __cfactx_switch( &src->context, &dst->context );
    94101        // when __cfactx_switch returns we are back in the src coroutine
     102
     103        /* paranoid */ verify( athrd->corctx_flag );
     104        athrd->corctx_flag = false;
    95105
    96106        // set state of new coroutine to active
Note: See TracChangeset for help on using the changeset viewer.