Changeset 4233338b for tests/unified_locking/mutex_test.hfa
- Timestamp:
- Jan 10, 2022, 4:07:04 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 56d711f
- Parents:
- 0ac728b (diff), 7d0ebd0 (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
-
tests/unified_locking/mutex_test.hfa
r0ac728b r4233338b 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.