Changeset d3e4d6c for src/libcfa/concurrency/monitor.c
- Timestamp:
- Aug 23, 2017, 6:22:07 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:
- 87e08e24, cb811ac
- Parents:
- 9f07232 (diff), bd37119 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor.c
r9f07232 rd3e4d6c 139 139 } 140 140 141 void ?{}( monitor_guard_t *this, monitor_desc ** m, int count ) {142 this ->m = m;143 this ->count = count;144 qsort(this ->m, count);145 enter( this ->m, this->count );146 147 this ->prev_mntrs = this_thread->current_monitors;148 this ->prev_count = this_thread->current_monitor_count;141 void ?{}( monitor_guard_t & this, monitor_desc ** m, int count ) { 142 this.m = m; 143 this.count = count; 144 qsort(this.m, count); 145 enter( this.m, this.count ); 146 147 this.prev_mntrs = this_thread->current_monitors; 148 this.prev_count = this_thread->current_monitor_count; 149 149 150 150 this_thread->current_monitors = m; … … 152 152 } 153 153 154 void ^?{}( monitor_guard_t *this ) {155 leave( this ->m, this->count );156 157 this_thread->current_monitors = this ->prev_mntrs;158 this_thread->current_monitor_count = this ->prev_count;159 } 160 161 void ?{}(__condition_node_t *this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {162 this ->waiting_thread = waiting_thread;163 this ->count = count;164 this ->next = NULL;165 this ->user_info = user_info;166 } 167 168 void ?{}(__condition_criterion_t *this ) {169 this ->ready = false;170 this ->target = NULL;171 this ->owner = NULL;172 this ->next = NULL;173 } 174 175 void ?{}(__condition_criterion_t *this, monitor_desc * target, __condition_node_t * owner ) {176 this ->ready = false;177 this ->target = target;178 this ->owner = owner;179 this ->next = NULL;154 void ^?{}( monitor_guard_t & this ) { 155 leave( this.m, this.count ); 156 157 this_thread->current_monitors = this.prev_mntrs; 158 this_thread->current_monitor_count = this.prev_count; 159 } 160 161 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) { 162 this.waiting_thread = waiting_thread; 163 this.count = count; 164 this.next = NULL; 165 this.user_info = user_info; 166 } 167 168 void ?{}(__condition_criterion_t & this ) { 169 this.ready = false; 170 this.target = NULL; 171 this.owner = NULL; 172 this.next = NULL; 173 } 174 175 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) { 176 this.ready = false; 177 this.target = target; 178 this.owner = owner; 179 this.next = NULL; 180 180 } 181 181 … … 202 202 __condition_criterion_t criteria[count]; 203 203 for(int i = 0; i < count; i++) { 204 ( &criteria[i]){ this->monitors[i], &waiter };204 (criteria[i]){ this->monitors[i], &waiter }; 205 205 // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] ); 206 206 } … … 314 314 __condition_criterion_t criteria[count]; 315 315 for(int i = 0; i < count; i++) { 316 ( &criteria[i]){ this->monitors[i], &waiter };316 (criteria[i]){ this->monitors[i], &waiter }; 317 317 // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] ); 318 318 push( &criteria[i].target->signal_stack, &criteria[i] ); … … 505 505 } 506 506 507 void ?{}( __condition_blocked_queue_t *this ) {508 this ->head = NULL;509 this ->tail = &this->head;507 void ?{}( __condition_blocked_queue_t & this ) { 508 this.head = NULL; 509 this.tail = &this.head; 510 510 } 511 511
Note:
See TracChangeset
for help on using the changeset viewer.