Ignore:
Timestamp:
Feb 14, 2017, 1:19:28 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
97d246d
Parents:
f923b5f (diff), eafb094 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rf923b5f rd3a804f5  
    3030      #define SCHEDULER_CAPACITY 10
    3131
     32      struct spinlock {
     33            volatile int lock;
     34      };
     35
    3236      struct simple_thread_list {
    3337            struct thread * head;
    3438            struct thread ** tail;
     39      };
     40
     41      struct signal_once {
     42            volatile bool condition;
     43            struct spinlock lock;
     44            struct simple_thread_list blocked;
    3545      };
    3646
     
    4050            void append( struct simple_thread_list *, struct thread * );
    4151            struct thread * pop_head( struct simple_thread_list * );
     52
     53            void ?{}(spinlock * this);
     54            void ^?{}(spinlock * this);
     55
     56            void ?{}(signal_once * this);
     57            void ^?{}(signal_once * this);
    4258      }
    4359      #endif
     
    5369      };
    5470
    55       enum coroutine_state { Start, Inactive, Active, Halt, Primed };
     71      enum coroutine_state { Halted, Start, Inactive, Active, Primed };
    5672
    5773      struct coroutine {
     
    6076            int errno_;                         // copy of global UNIX variable errno
    6177            enum coroutine_state state; // current execution status for coroutine
    62             bool notHalted;                     // indicate if execuation state is not halted
    63 
    6478            struct coroutine *starter;  // first coroutine to resume this one
    6579            struct coroutine *last;             // last coroutine to resume this one
    6680      };
    6781
    68       struct simple_lock {
    69         struct simple_thread_list blocked;
    70       };
    71 
    7282      struct thread {
    73             struct coroutine c;
    74             struct simple_lock lock;
    75             struct thread * next;
     83            struct coroutine c;           // coroutine body used to store context
     84            struct signal_once terminated;// indicate if execuation state is not halted
     85            struct thread * next;         // instrusive link field for threads
    7686      };
    7787
Note: See TracChangeset for help on using the changeset viewer.