Changeset 6fafda8
- Timestamp:
- Jan 6, 2022, 10:53:44 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 04a8a54, 7d0ebd0
- Parents:
- eaf269d (diff), 7636fcc (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:
-
- 2 added
- 1 deleted
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
reaf269d r6fafda8 177 177 }; 178 178 179 static inline void ?{}(fast_lock & this) __attribute__((deprecated("use linear_backoff_then_block_lock instead"))); 179 180 static inline void ?{}(fast_lock & this) { this.owner = 0p; } 180 181 … … 184 185 } 185 186 186 static inline void lock( fast_lock & this ) __attribute__(( artificial));187 static inline void lock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial)); 187 188 static inline void lock( fast_lock & this ) { 188 189 thread$ * thrd = active_thread(); … … 195 196 } 196 197 197 static inline bool try_lock( fast_lock & this ) __attribute__(( artificial));198 static inline bool try_lock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial)); 198 199 static inline bool try_lock ( fast_lock & this ) { 199 200 thread$ * thrd = active_thread(); … … 202 203 } 203 204 204 static inline thread$ * unlock( fast_lock & this ) __attribute__(( artificial));205 static inline thread$ * unlock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial)); 205 206 static inline thread$ * unlock( fast_lock & this ) { 206 207 /* paranoid */ verify(active_thread() == this.owner); -
tests/unified_locking/mutex_test.hfa
reaf269d r6fafda8 10 10 thread$ * id; 11 11 uint32_t sum; 12 uint32_t cnt; 12 13 }; 13 14 … … 27 28 { 28 29 uint32_t tsum = mo.sum; 30 uint32_t cnt = mo.cnt; 29 31 mo.id = me; 30 32 yield(random(5)); 31 33 value = ((uint32_t)random()) ^ ((uint32_t)me); 32 34 if(mo.id != me) sout | "Intruder!"; 35 mo.cnt = cnt + 1; 33 36 mo.sum = tsum + value; 34 37 } … … 54 57 uint32_t sum = -32; 55 58 mo.sum = -32; 59 mo.cnt = 0; 56 60 processor p[2]; 57 61 sout | "Starting"; … … 63 67 } 64 68 sout | "Done!"; 69 if(mo.cnt != (13 * num_times)) sout | "Invalid cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')'; 65 70 if(sum == mo.sum) sout | "Match!"; 66 71 else sout | "No Match!" | sum | "vs" | mo.sum;
Note: See TracChangeset
for help on using the changeset viewer.