Changeset d61d034 for libcfa/src/concurrency
- Timestamp:
- Jan 13, 2023, 4:30:28 PM (23 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 34a1d2e, 997185e
- Parents:
- 8bb86ce (diff), 42b739d7 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/channel.hfa
r8bb86ce rd61d034 35 35 static inline void ?{}( channel(T) &c ){ ((channel(T) &)c){ 0 }; } 36 36 static inline void ^?{}( channel(T) &c ) with(c) { delete( buffer ); } 37 inline size_t get_count( channel(T) & chan ) with(chan) { return count; } 38 inline size_t get_size( channel(T) & chan ) with(chan) { return size; } 37 static inline size_t get_count( channel(T) & chan ) with(chan) { return count; } 38 static inline size_t get_size( channel(T) & chan ) with(chan) { return size; } 39 static inline bool has_waiters( channel(T) & chan ) with(chan) { return !empty( cons ) || !empty( prods ); } 40 static inline bool has_waiting_consumers( channel(T) & chan ) with(chan) { return !empty( cons ); } 41 static inline bool has_waiting_producers( channel(T) & chan ) with(chan) { return !empty( prods ); } 39 42 40 inline void insert_( channel(T) & chan, T elem ) with(chan) {43 static inline void insert_( channel(T) & chan, T elem ) with(chan) { 41 44 memcpy((void *)&buffer[back], (void *)&elem, sizeof(T)); 42 45 count += 1; … … 46 49 47 50 48 inline void insert( channel(T) & chan, T elem ) with(chan) {51 static inline void insert( channel(T) & chan, T elem ) with(chan) { 49 52 lock( mutex_lock ); 50 53 … … 72 75 } 73 76 74 inline T remove( channel(T) & chan ) with(chan) {77 static inline T remove( channel(T) & chan ) with(chan) { 75 78 lock( mutex_lock ); 76 79 T retval;
Note: See TracChangeset
for help on using the changeset viewer.