Ignore:
Timestamp:
Feb 15, 2017, 8:13:49 AM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
e6512c8
Parents:
aa9ee19 (diff), 3149e7e (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    raa9ee19 r97f65d5  
    99//
    1010// Author           : Thierry Delisle
    11 // Created On       : Tue Jan 17 12:27:26 2016
     11// Created On       : Tue Jan 17 12:27:26 2017
    1212// Last Modified By : Thierry Delisle
    1313// Last Modified On : --
     
    2727
    2828//-----------------------------------------------------------------------------
     29// Locks
     30void lock( spinlock * );
     31void unlock( spinlock * );
     32
     33void wait( signal_once * );
     34void signal( signal_once * );
     35
     36//-----------------------------------------------------------------------------
    2937// Cluster
    3038struct cluster {
    3139        simple_thread_list ready_queue;
    32         // pthread_spinlock_t lock;
     40        spinlock lock;
    3341};
    3442
     
    3846//-----------------------------------------------------------------------------
    3947// Processor
    40 enum ProcessorAction {
    41         Reschedule,
    42         NoAction
     48enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule };
     49struct FinishAction {
     50        FinishOpCode action_code;
     51        thread * thrd;
     52        spinlock * lock;
    4353};
     54static inline void ?{}(FinishAction * this) {
     55        this->action_code = No_Action;
     56        this->thrd = NULL;
     57        this->lock = NULL;
     58}
     59static inline void ^?{}(FinishAction * this) {}
    4460
    4561struct processor {
     
    4965        thread * current_thread;
    5066        pthread_t kernel_thread;
    51         simple_lock lock;
    52         volatile bool terminated;
    53         ProcessorAction thread_action;
     67       
     68        signal_once terminated;
     69        volatile bool is_terminated;
     70
     71        struct FinishAction finish;
    5472};
    5573
     
    5775void ?{}(processor * this, cluster * cltr);
    5876void ^?{}(processor * this);
    59 
    60 
    61 //-----------------------------------------------------------------------------
    62 // Locks
    63 
    64 void ?{}(simple_lock * this);
    65 void ^?{}(simple_lock * this);
    66 
    67 void lock( simple_lock * );
    68 void unlock( simple_lock * );
    6977
    7078#endif //KERNEL_H
Note: See TracChangeset for help on using the changeset viewer.