Changeset 35d73c0
- Timestamp:
- Jan 6, 2022, 11:55:55 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 7636fcc
- Parents:
- 10b3fc3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/mutex_test.hfa
r10b3fc3 r35d73c0 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.