Ignore:
Timestamp:
Feb 13, 2020, 4:18:07 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
50b8885
Parents:
9f575ea
Message:

Added park/unpark primitives thread and removed BlockInternal?.
Converted monitors to use park unpark.
Intrusive Queue now mark next field when thread is inside queue.
Added several asserts to kernel and monitor.
Added a few tests for park and unpark.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/invoke.h

    r9f575ea r3381ed7  
    9393
    9494        enum coroutine_state { Halted, Start, Primed, Inactive, Active, Rerun, Reschedule };
     95        enum __Preemption_Reason { __NO_PREEMPTION, __ALARM_PREEMPTION, __POLL_PREEMPTION };
     96        enum __Owner_Reason { __NO_OWNER, __ENTER_FREE, __ENTER_ACCEPT, __ENTER_DTOR_FREE, __ENTER_DTOR_ACCEPT, __ENTER_SIGNAL_BLOCK, __WAITFOR, __LEAVE, __LEAVE_THREAD, __WAIT };
    9597
    9698        struct coroutine_desc {
     
    134136                struct thread_desc * owner;
    135137
     138                enum __Owner_Reason owner_reason;
     139
    136140                // queue of threads that are blocked waiting for the monitor
    137141                __queue_t(struct thread_desc) entry_queue;
     
    165169                // current execution status for coroutine
    166170                volatile int state;
    167                 int preempted;
     171                enum __Preemption_Reason preempted;
    168172
    169173                //SKULLDUGGERY errno is not save in the thread data structure because returnToKernel appears to be the only function to require saving and restoring it
Note: See TracChangeset for help on using the changeset viewer.