Ignore:
Timestamp:
Mar 31, 2017, 1:04:21 PM (8 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:
23063ea
Parents:
78d3dd5
Message:

Prototype of multi monitor internal scheduling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    r78d3dd5 r5ea06d6  
    3030}
    3131
    32 //Array entering routine
    33 void enter(monitor_desc **, int count);
    34 void leave(monitor_desc **, int count);
    35 
    3632struct monitor_guard_t {
    3733        monitor_desc ** m;
    3834        int count;
     35      monitor_desc ** prev_mntrs;
     36      unsigned short  prev_count;
    3937};
    4038
     
    4341}
    4442
    45 static inline void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
    46         this->m = m;
    47         this->count = count;
    48         qsort(this->m, count);
    49         enter( this->m, this->count );
     43void ?{}( monitor_guard_t * this, monitor_desc ** m, int count );
     44void ^?{}( monitor_guard_t * this );
     45
     46//-----------------------------------------------------------------------------
     47// Internal scheduling
     48struct condition {
     49        __thread_queue_t blocked;
     50        monitor_desc ** monitors;
     51        unsigned short monitor_count;
     52};
     53
     54static inline void ?{}( condition * this ) {
     55        this->monitors = NULL;
     56        this->monitor_count = 0;
    5057}
    5158
    52 static inline void ^?{}( monitor_guard_t * this ) {
    53         leave( this->m, this->count );
    54 }
    55 
    56 
     59void wait( condition * this );
     60void signal( condition * this );
    5761#endif //MONITOR_H
Note: See TracChangeset for help on using the changeset viewer.