Changeset 6b33e89 for libcfa/src/concurrency/barrier.hfa
- Timestamp:
- Apr 25, 2025, 7:39:09 AM (5 months ago)
- Branches:
- master
- Children:
- 65bd3c2
- Parents:
- b195498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/barrier.hfa
rb195498 r6b33e89 11 11 // Created On : Sun Nov 10 08:07:35 2024 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Nov 13 12:37:04 202414 // Update Count : 913 // Last Modified On : Thu Apr 24 22:41:11 2025 14 // Update Count : 12 15 15 // 16 16 … … 31 31 32 32 // Returns a value indicating the reverse order the threads arrived, i.e. last thread returns 0 (and does not block) 33 // lastis an optional hook that is called by the Gth thread before unblocking the other threads.34 static inline unsigned int block( barrier & mutex b, fptr_t last= (fptr_t)0 ) with( b ) {33 // hook is an optional hook that is called by the Gth thread before unblocking the other threads. 34 static inline unsigned int block( barrier & mutex b, fptr_t hook = (fptr_t)0 ) with( b ) { 35 35 arrivals -= 1; // prefix decrement so last is 0 not 1 36 36 unsigned arrived = b.arrivals; // note arrival order … … 38 38 wait( b.c ); 39 39 } else { // group formed 40 if ( last ) last(); // safe to call40 if ( hook ) hook(); // safe to call 41 41 signal_all( c ); // unblock group 42 42 arrivals = group; // reset
Note:
See TracChangeset
for help on using the changeset viewer.