Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    reafb094 r9e45e46  
    99//
    1010// Author           : Thierry Delisle
    11 // Created On       : Tue Jan 17 12:27:26 2017
     11// Created On       : Tue Jan 17 12:27:26 2016
    1212// Last Modified By : Thierry Delisle
    1313// Last Modified On : --
     
    2727
    2828//-----------------------------------------------------------------------------
    29 // Locks
    30 void lock( spinlock * );
    31 void unlock( spinlock * );
    32 
    33 void wait( signal_once * );
    34 void signal( signal_once * );
    35 
    36 //-----------------------------------------------------------------------------
    3729// Cluster
    3830struct cluster {
    3931        simple_thread_list ready_queue;
    40         spinlock lock;
     32        // pthread_spinlock_t lock;
    4133};
    4234
     
    4638//-----------------------------------------------------------------------------
    4739// Processor
    48 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule };
    49 struct FinishAction {
    50         FinishOpCode action_code;
    51         thread * thrd;
    52         spinlock * lock;
     40enum ProcessorAction {
     41        Reschedule,
     42        NoAction
    5343};
    54 static inline void ?{}(FinishAction * this) {
    55         this->action_code = No_Action;
    56         this->thrd = NULL;
    57         this->lock = NULL;
    58 }
    59 static inline void ^?{}(FinishAction * this) {}
    6044
    6145struct processor {
     
    6549        thread * current_thread;
    6650        pthread_t kernel_thread;
    67        
    68         signal_once terminated;
    69         volatile bool is_terminated;
    70 
    71         struct FinishAction finish;
     51        simple_lock lock;
     52        volatile bool terminated;
     53        ProcessorAction thread_action;
    7254};
    7355
     
    7557void ?{}(processor * this, cluster * cltr);
    7658void ^?{}(processor * this);
     59
     60
     61//-----------------------------------------------------------------------------
     62// Locks
     63
     64void ?{}(simple_lock * this);
     65void ^?{}(simple_lock * this);
     66
     67void lock( simple_lock * );
     68void unlock( simple_lock * );
    7769
    7870#endif //KERNEL_H
Note: See TracChangeset for help on using the changeset viewer.