Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    r6b0b624 rbf7b9da7  
    2222#include "stdlib"
    2323
    24 static inline void ?{}(monitor_desc * this) {
    25         this->owner = NULL;
    26         this->recursion = 0;
     24static inline void ?{}(monitor_desc & this) {
     25        (this.lock){};
     26        this.owner = NULL;
     27        (this.entry_queue){};
     28        (this.signal_stack){};
     29        this.recursion = 0;
     30        this.acceptables = NULL;
     31        this.acceptable_count = 0;
     32        this.accepted_index = -1;
    2733}
    2834
     
    3238        monitor_desc ** prev_mntrs;
    3339        unsigned short  prev_count;
     40        fptr_t          prev_func;
    3441};
    3542
     
    3845}
    3946
    40 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count );
    41 void ^?{}( monitor_guard_t * this );
     47void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() );
     48void ^?{}( monitor_guard_t & this );
    4249
    4350//-----------------------------------------------------------------------------
     
    6471};
    6572
    66 void ?{}( __condition_blocked_queue_t * );
     73void ?{}( __condition_blocked_queue_t & );
    6774void append( __condition_blocked_queue_t *, __condition_node_t * );
    6875__condition_node_t * pop_head( __condition_blocked_queue_t * );
     
    7481};
    7582
    76 static inline void ?{}( condition * this ) {
    77         this->monitors = NULL;
    78         this->monitor_count = 0;
     83static inline void ?{}( condition & this ) {
     84        this.monitors = NULL;
     85        this.monitor_count = 0;
    7986}
    8087
    81 static inline void ^?{}( condition * this ) {
    82         free( this->monitors );
     88static inline void ^?{}( condition & this ) {
     89        free( this.monitors );
    8390}
    8491
     
    8996uintptr_t front( condition * this );
    9097
     98//-----------------------------------------------------------------------------
     99// External scheduling
     100
    91101struct __acceptable_t {
    92         void (*func)(void);
     102        fptr_t func;
    93103        unsigned short count;
    94         monitor_desc * monitors[1];
     104        monitor_desc ** monitors;
    95105};
    96106
    97 void __accept_internal( unsigned short count, __acceptable_t * acceptables, void (*func)(void) );
     107int __accept_internal( unsigned short count, __acceptable_t * acceptables );
    98108
    99109// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.