Ignore:
Timestamp:
Jul 6, 2017, 4:18:43 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
955d27e9
Parents:
b877fa8
Message:

Removed signal_once type, use semaphore instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    rb877fa8 rbdeba0b  
    3333void unlock    ( spinlock * );
    3434
    35 struct signal_once {
    36         volatile bool cond;
    37         struct spinlock lock;
    38         struct __thread_queue_t blocked;
     35struct semaphore {
     36        spinlock lock;
     37        int count;
     38        __thread_queue_t waiting;
    3939};
    4040
    41 void ?{}(signal_once * this);
    42 void ^?{}(signal_once * this);
     41void  ?{}(semaphore * this, int count = 1);
     42void ^?{}(semaphore * this);
     43void P(semaphore * this);
     44void V(semaphore * this);
    4345
    44 void wait( signal_once * );
    45 void signal( signal_once * );
    4646
    4747//-----------------------------------------------------------------------------
     
    8181        pthread_t kernel_thread;
    8282
    83         signal_once terminated;
     83        semaphore terminated;
    8484        volatile bool is_terminated;
    8585
Note: See TracChangeset for help on using the changeset viewer.