Changeset 2c24971
- Timestamp:
- May 11, 2023, 8:28:12 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 8fa3b660
- Parents:
- 9eb7f07c (diff), 7b53bfd (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. - Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/channel.hfa
r9eb7f07c r2c24971 73 73 if ( size != 0 ) delete( buffer ); 74 74 } 75 static inline size_t get_count( channel(T) & chan ) with(chan) { return count; }75 static inline size_t get_count( channel(T) & chan ) with(chan) { return __atomic_load_n( &count, __ATOMIC_SEQ_CST); } 76 76 static inline size_t get_size( channel(T) & chan ) with(chan) { return size; } 77 77 static inline bool has_waiters( channel(T) & chan ) with(chan) { return !cons`isEmpty || !prods`isEmpty; } -
tests/concurrent/waituntil/one_chan.cfa
r9eb7f07c r2c24971 37 37 printf("waiting for empty channels\n"); 38 38 LINE_COUNTER = 3; 39 size_t C_count = get_count( C );40 LINE_COUNTER = 5;41 while( C_count > 0 ) {42 C_count = get_count( C );43 }39 // size_t C_count = get_count( C ); 40 // LINE_COUNTER = 5; 41 // while( C_count > 0 ) { 42 // C_count = get_count( C ); 43 // } 44 44 LINE_COUNTER = 7; 45 45 printf("sending sentinels\n"); … … 50 50 LINE_COUNTER = 17; 51 51 } 52 assert(get_count( C ) == 0); 52 53 LINE_COUNTER = 19; 53 54 if ( total != globalTotal )
Note: See TracChangeset
for help on using the changeset viewer.