Changeset c366ec6 for src/libcfa
- Timestamp:
- Oct 10, 2017, 4:29:47 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:
- d2e2865
- Parents:
- 08da53d (diff), c386bc1 (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. - Location:
- src/libcfa/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor
r08da53d rc366ec6 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:59:01201713 // Update Count : 312 // Last Modified On : Sat Oct 7 18:06:45 2017 13 // Update Count : 10 14 14 // 15 15 … … 54 54 void ^?{}( monitor_guard_t & this ); 55 55 56 57 56 struct monitor_dtor_guard_t { 58 57 monitor_desc * m; … … 64 63 void ?{}( monitor_dtor_guard_t & this, monitor_desc ** m, void (*func)() ); 65 64 void ^?{}( monitor_dtor_guard_t & this ); 65 66 static inline forall( dtype T | sized(T) | { void ^?{}( T & mutex ); } ) 67 void delete( T * th ) { 68 ^(*th){}; 69 free( th ); 70 } 66 71 67 72 //----------------------------------------------------------------------------- -
src/libcfa/concurrency/monitor.c
r08da53d rc366ec6 409 409 short thread_count = 0; 410 410 thread_desc * threads[ count ]; 411 for(int i = 0; i < count; i++) { 412 threads[i] = 0; 413 } 411 __builtin_memset( threads, 0, sizeof( threads ) ); 414 412 415 413 // Save monitor states … … 535 533 short max = count_max( mask ); 536 534 monitor_desc * mon_storage[max]; 535 __builtin_memset( mon_storage, 0, sizeof( mon_storage ) ); 537 536 short actual_count = aggregate( mon_storage, mask ); 537 538 LIB_DEBUG_PRINT_SAFE("Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (short)max); 538 539 539 540 if(actual_count == 0) return;
Note: See TracChangeset
for help on using the changeset viewer.