Changeset c1a9c86
- Timestamp:
- Nov 2, 2017, 5:59:12 PM (6 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:
- 59a0bde
- Parents:
- 513daec
- Location:
- src/libcfa/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.h
r513daec rc1a9c86 66 66 struct coStack_t { 67 67 // size of stack 68 unsigned int size;68 size_t size; 69 69 70 70 // pointer to stack … … 85 85 // whether or not the user allocated the stack 86 86 bool userStack; 87 88 87 }; 89 88 … … 118 117 119 118 // number of acceptable functions 120 short size;119 __lock_size_t size; 121 120 }; 122 121 … … 149 148 150 149 // number of currently held monitors 151 shortsize;150 __lock_size_t size; 152 151 153 152 // last function that acquired monitors 154 fptr_t 153 fptr_t func; 155 154 }; 156 155 … … 168 167 // monitors currently held by this thread 169 168 struct __monitor_group_t monitors; 170 171 169 172 170 // Link lists fields -
src/libcfa/concurrency/monitor
r513daec rc1a9c86 43 43 int count; 44 44 monitor_desc ** prev_mntrs; 45 unsigned shortprev_count;45 __lock_size_t prev_count; 46 46 fptr_t prev_func; 47 47 }; … … 53 53 monitor_desc * m; 54 54 monitor_desc ** prev_mntrs; 55 unsigned shortprev_count;55 __lock_size_t prev_count; 56 56 fptr_t prev_func; 57 57 }; … … 81 81 // Intrusive linked list Next field 82 82 __condition_criterion_t * next; 83 84 83 }; 85 84 … … 92 91 93 92 // Number of criterions in the criteria 94 unsigned short count;93 __lock_size_t count; 95 94 96 95 // Intrusive linked list Next field … … 99 98 // Custom user info accessible before signalling 100 99 uintptr_t user_info; 101 102 100 }; 103 101 … … 123 121 124 122 // Number of monitors in the array 125 unsigned short monitor_count; 126 123 __lock_size_t monitor_count; 127 124 }; 128 125 -
src/libcfa/concurrency/monitor.c
r513daec rc1a9c86 296 296 297 297 // Save previous thread context 298 this.prev_mntrs = this_thread->monitors.list; 299 this.prev_count = this_thread->monitors.size; 300 this.prev_func = this_thread->monitors.func; 298 this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func]; 301 299 302 300 // Update thread context (needed for conditions) 303 this_thread->monitors.list = m; 304 this_thread->monitors.size = count; 305 this_thread->monitors.func = func; 301 this_thread->monitors.[list, size, func] = [m, count, func]; 306 302 307 303 // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count); … … 325 321 326 322 // Restore thread context 327 this_thread->monitors.list = this.prev_mntrs; 328 this_thread->monitors.size = this.prev_count; 329 this_thread->monitors.func = this.prev_func; 323 this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func]; 330 324 } 331 325 … … 337 331 338 332 // Save previous thread context 339 this.prev_mntrs = this_thread->monitors.list; 340 this.prev_count = this_thread->monitors.size; 341 this.prev_func = this_thread->monitors.func; 333 this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func]; 342 334 343 335 // Update thread context (needed for conditions) 344 this_thread->monitors.list = m; 345 this_thread->monitors.size = 1; 346 this_thread->monitors.func = func; 336 this_thread->monitors.[list, size, func] = [m, 1, func]; 347 337 348 338 __enter_monitor_dtor( this.m, func ); … … 355 345 356 346 // Restore thread context 357 this_thread->monitors.list = this.prev_mntrs; 358 this_thread->monitors.size = this.prev_count; 359 this_thread->monitors.func = this.prev_func; 347 this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func]; 360 348 } 361 349
Note: See TracChangeset
for help on using the changeset viewer.