Changeset 5ea06d6 for src/libcfa/concurrency/monitor
- Timestamp:
- Mar 31, 2017, 1:04:21 PM (8 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor
r78d3dd5 r5ea06d6 30 30 } 31 31 32 //Array entering routine33 void enter(monitor_desc **, int count);34 void leave(monitor_desc **, int count);35 36 32 struct monitor_guard_t { 37 33 monitor_desc ** m; 38 34 int count; 35 monitor_desc ** prev_mntrs; 36 unsigned short prev_count; 39 37 }; 40 38 … … 43 41 } 44 42 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 ); 43 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ); 44 void ^?{}( monitor_guard_t * this ); 45 46 //----------------------------------------------------------------------------- 47 // Internal scheduling 48 struct condition { 49 __thread_queue_t blocked; 50 monitor_desc ** monitors; 51 unsigned short monitor_count; 52 }; 53 54 static inline void ?{}( condition * this ) { 55 this->monitors = NULL; 56 this->monitor_count = 0; 50 57 } 51 58 52 static inline void ^?{}( monitor_guard_t * this ) { 53 leave( this->m, this->count ); 54 } 55 56 59 void wait( condition * this ); 60 void signal( condition * this ); 57 61 #endif //MONITOR_H
Note:
See TracChangeset
for help on using the changeset viewer.