Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    r85b1deb ra1a17a74  
    2323extern "C" {
    2424#include <pthread.h>
    25 #include <semaphore.h>
    2625}
    2726
     
    4443extern struct cluster * mainCluster;
    4544
    46 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule, Callback };
    47 
    48 typedef void (*__finish_callback_fptr_t)(void);
     45enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule };
    4946
    5047//TODO use union, many of these fields are mutually exclusive (i.e. MULTI vs NOMULTI)
    5148struct FinishAction {
    5249        FinishOpCode action_code;
    53         /*
    54         // Union of possible actions
    55         union {
    56                 // Option 1 : locks and threads
    57                 struct {
    58                         // 1 thread or N thread
    59                         union {
    60                                 thread_desc * thrd;
    61                                 struct {
    62                                         thread_desc ** thrds;
    63                                         unsigned short thrd_count;
    64                                 };
    65                         };
    66                         // 1 lock or N lock
    67                         union {
    68                                 __spinlock_t * lock;
    69                                 struct {
    70                                         __spinlock_t ** locks;
    71                                         unsigned short lock_count;
    72                                 };
    73                         };
    74                 };
    75                 // Option 2 : action pointer
    76                 __finish_callback_fptr_t callback;
    77         };
    78         /*/
    7950        thread_desc * thrd;
    80         thread_desc ** thrds;
    81         unsigned short thrd_count;
    8251        __spinlock_t * lock;
    8352        __spinlock_t ** locks;
    8453        unsigned short lock_count;
    85         __finish_callback_fptr_t callback;
    86         //*/
     54        thread_desc ** thrds;
     55        unsigned short thrd_count;
    8756};
    8857static inline void ?{}(FinishAction & this) {
     
    11382        pthread_t kernel_thread;
    11483
     84        // Termination
     85        // Set to true to notify the processor should terminate
     86        volatile bool do_terminate;
     87
     88        // Termination synchronisation
     89        semaphore terminated;
     90
    11591        // RunThread data
    11692        // Action to do after a thread is ran
     
    125101
    126102        // Idle lock
    127         __bin_sem_t idleLock;
    128 
    129         // Termination
    130         // Set to true to notify the processor should terminate
    131         volatile bool do_terminate;
    132 
    133         // Termination synchronisation
    134         semaphore terminated;
    135103
    136104        // Link lists fields
    137         struct __dbg_node_proc {
     105        struct {
    138106                struct processor * next;
    139107                struct processor * prev;
     
    182150
    183151        // Link lists fields
    184         struct __dbg_node_cltr {
     152        struct {
    185153                cluster * next;
    186154                cluster * prev;
Note: See TracChangeset for help on using the changeset viewer.