Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    r2781e65 rcc7f4b1  
    2020#include "assert"
    2121#include "invoke.h"
    22 #include "stdlib"
    2322
    2423struct __monitor_t {
     
    3433}
    3534
    36 //Basic entering routine
    3735void enter(__monitor_t *);
    3836void leave(__monitor_t *);
    3937
    40 //Array entering routine
    41 void enter(__monitor_t **, int count);
    42 void leave(__monitor_t **, int count);
    43 
    4438struct monitor_guard_t {
    45         __monitor_t ** m;
    46         int count;
     39        __monitor_t * m;
    4740};
    4841
    49 static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) {
    50         return ((intptr_t)lhs) < ((intptr_t)rhs);
    51 }
    52 
    53 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) {
     42static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) {
    5443        this->m = m;
    55         this->count = 1;
    56         enter( *this->m );
    57 }
    58 
    59 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) {
    60         this->m = m;
    61         this->count = count;
    62         qsort(this->m, count);
    63         enter( this->m, this->count );
     44        enter( this->m );
    6445}
    6546
    6647static inline void ^?{}( monitor_guard_t * this ) {
    67         leave( this->m, this->count );
     48        leave( this->m );
    6849}
    6950
    70 
    7151#endif //MONITOR_H
Note: See TracChangeset for help on using the changeset viewer.