Changeset 95707a3
- Timestamp:
- Nov 16, 2024, 6:33:41 PM (5 weeks ago)
- Branches:
- master
- Children:
- dd54139
- Parents:
- e255902b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/barrier.hfa
re255902b r95707a3 11 11 // Created On : Sun Nov 10 08:07:35 2024 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Nov 10 08:11:55202414 // Update Count : 313 // Last Modified On : Wed Nov 13 12:37:04 2024 14 // Update Count : 9 15 15 // 16 16 … … 26 26 }; 27 27 28 // Constructor 29 void ?{}( barrier & b, unsigned group ) { 30 b.group = b.arrivals = group; // count backwards 28 static inline void ?{}( barrier & b, unsigned int group ) { 29 b.group = b.arrivals = group; // arrivals count backward 31 30 } 32 31 33 // Returns a value indicating the reverse order the threads arrived i.e. last thread returns 0 (and does not block)34 // last is an optional hook that is called by the last thread before unblocking the others.35 static inline unsigned block( barrier & mutex b, fptr_t last = (fptr_t)0 ) with( b ) {32 // Returns a value indicating the reverse order the threads arrived, i.e. last thread returns 0 (and does not block) 33 // last 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 last = (fptr_t)0 ) with( b ) { 36 35 arrivals -= 1; // prefix decrement so last is 0 not 1 37 36 unsigned arrived = b.arrivals; // note arrival order
Note: See TracChangeset
for help on using the changeset viewer.