Changeset 242a902 for src/libcfa/concurrency/monitor.c
- Timestamp:
- Jul 18, 2017, 4:35:52 PM (7 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:
- f19339e
- Parents:
- 795d450
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor.c
r795d450 r242a902 140 140 } 141 141 142 void ?{}( monitor_guard_t *this, monitor_desc ** m, int count ) {143 this ->m = m;144 this ->count = count;145 qsort(this ->m, count);146 enter( this ->m, this->count );147 148 this ->prev_mntrs = this_thread->current_monitors;149 this ->prev_count = this_thread->current_monitor_count;142 void ?{}( monitor_guard_t & this, monitor_desc ** m, int count ) { 143 this.m = m; 144 this.count = count; 145 qsort(this.m, count); 146 enter( this.m, this.count ); 147 148 this.prev_mntrs = this_thread->current_monitors; 149 this.prev_count = this_thread->current_monitor_count; 150 150 151 151 this_thread->current_monitors = m; … … 153 153 } 154 154 155 void ^?{}( monitor_guard_t *this ) {156 leave( this ->m, this->count );157 158 this_thread->current_monitors = this ->prev_mntrs;159 this_thread->current_monitor_count = this ->prev_count;160 } 161 162 void ?{}(__condition_node_t *this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {163 this ->waiting_thread = waiting_thread;164 this ->count = count;165 this ->next = NULL;166 this ->user_info = user_info;167 } 168 169 void ?{}(__condition_criterion_t *this ) {170 this ->ready = false;171 this ->target = NULL;172 this ->owner = NULL;173 this ->next = NULL;174 } 175 176 void ?{}(__condition_criterion_t *this, monitor_desc * target, __condition_node_t * owner ) {177 this ->ready = false;178 this ->target = target;179 this ->owner = owner;180 this ->next = NULL;155 void ^?{}( monitor_guard_t & this ) { 156 leave( this.m, this.count ); 157 158 this_thread->current_monitors = this.prev_mntrs; 159 this_thread->current_monitor_count = this.prev_count; 160 } 161 162 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) { 163 this.waiting_thread = waiting_thread; 164 this.count = count; 165 this.next = NULL; 166 this.user_info = user_info; 167 } 168 169 void ?{}(__condition_criterion_t & this ) { 170 this.ready = false; 171 this.target = NULL; 172 this.owner = NULL; 173 this.next = NULL; 174 } 175 176 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) { 177 this.ready = false; 178 this.target = target; 179 this.owner = owner; 180 this.next = NULL; 181 181 } 182 182 … … 506 506 } 507 507 508 void ?{}( __condition_blocked_queue_t *this ) {509 this ->head = NULL;510 this ->tail = &this->head;508 void ?{}( __condition_blocked_queue_t & this ) { 509 this.head = NULL; 510 this.tail = &this.head; 511 511 } 512 512
Note: See TracChangeset
for help on using the changeset viewer.