Changeset 4b30e8cc


Ignore:
Timestamp:
Nov 4, 2020, 2:53:17 PM (3 years ago)
Author:
Colby Alexander Parsons <caparsons@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c28ea4e
Parents:
8fd0ce3
Message:

added callback support

File:
1 edited

Legend:

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

    r8fd0ce3 r4b30e8cc  
    105105
    106106                // Check if this is a kernel
    107                 if( node->kernel_alarm ) {
     107                if( node->type == Kernel ) {
    108108                        preempt( node->proc );
    109109                }
     110                else if( node->type == User ) {
     111                        timeout( id, node->thrd );
     112                }
    110113                else {
    111                         timeout( id, node->thrd );
     114                        bool unpark_thd = node->callback(*node);
     115                        if (unpark_thd) timeout( id, node->thrd );
    112116                }
    113117
Note: See TracChangeset for help on using the changeset viewer.