Changes in src/libcfa/concurrency/monitor [2781e65:cc7f4b1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor
r2781e65 rcc7f4b1 20 20 #include "assert" 21 21 #include "invoke.h" 22 #include "stdlib"23 22 24 23 struct __monitor_t { … … 34 33 } 35 34 36 //Basic entering routine37 35 void enter(__monitor_t *); 38 36 void leave(__monitor_t *); 39 37 40 //Array entering routine41 void enter(__monitor_t **, int count);42 void leave(__monitor_t **, int count);43 44 38 struct monitor_guard_t { 45 __monitor_t ** m; 46 int count; 39 __monitor_t * m; 47 40 }; 48 41 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 ) { 42 static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) { 54 43 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 ); 64 45 } 65 46 66 47 static inline void ^?{}( monitor_guard_t * this ) { 67 leave( this->m , this->count);48 leave( this->m ); 68 49 } 69 50 70 71 51 #endif //MONITOR_H
Note:
See TracChangeset
for help on using the changeset viewer.