Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    rc81ebf9 rbdeba0b  
    2828//-----------------------------------------------------------------------------
    2929// Locks
    30 bool try_lock( spinlock * );
    31 void lock( spinlock * );
    32 void unlock( spinlock * );
     30bool try_lock  ( spinlock * DEBUG_CTX_PARAM2 );
     31void lock      ( spinlock * DEBUG_CTX_PARAM2 );
     32void lock_yield( spinlock * DEBUG_CTX_PARAM2 );
     33void unlock    ( spinlock * );
    3334
    34 struct signal_once {
    35         volatile bool cond;
    36         struct spinlock lock;
    37         struct __thread_queue_t blocked;
     35struct semaphore {
     36        spinlock lock;
     37        int count;
     38        __thread_queue_t waiting;
    3839};
    3940
    40 void ?{}(signal_once * this);
    41 void ^?{}(signal_once * this);
     41void  ?{}(semaphore * this, int count = 1);
     42void ^?{}(semaphore * this);
     43void P(semaphore * this);
     44void V(semaphore * this);
    4245
    43 void wait( signal_once * );
    44 void signal( signal_once * );
    4546
    4647//-----------------------------------------------------------------------------
     
    6869        unsigned short thrd_count;
    6970};
    70 static inline void ?{}(FinishAction * this) { 
     71static inline void ?{}(FinishAction * this) {
    7172        this->action_code = No_Action;
    7273        this->thrd = NULL;
     
    7879        struct processorCtx_t * runner;
    7980        cluster * cltr;
    80         coroutine_desc * current_coroutine;
    81         thread_desc * current_thread;
    8281        pthread_t kernel_thread;
    83        
    84         signal_once terminated;
     82
     83        semaphore terminated;
    8584        volatile bool is_terminated;
    8685
     
    9089        unsigned int preemption;
    9190
    92         unsigned short disable_preempt_count;
     91        bool pending_preemption;
    9392
    94         bool pending_preemption;
     93        char * last_enable;
    9594};
    9695
Note: See TracChangeset for help on using the changeset viewer.