Changeset bae0d35 for tests/unified_locking
- Timestamp:
- Jun 7, 2021, 2:09:12 PM (5 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 5a46e09
- Parents:
- 82f4063 (diff), 53692b3 (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. - Location:
- tests/unified_locking
- Files:
-
- 2 edited
-
fast.cfa (modified) (4 diffs)
-
timeout_lock.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/fast.cfa
r82f4063 rbae0d35 8 8 fast_lock l; 9 9 $thread * id; 10 size_t sum;10 uint32_t sum; 11 11 }; 12 12 … … 20 20 } 21 21 22 u nsignedcs() {22 uint32_t cs() { 23 23 $thread * me = active_thread(); 24 u nsigned value = (unsigned)me;24 uint32_t value = (uint32_t)me; 25 25 lock(mo.l); 26 26 { 27 size_t tsum = mo.sum;27 uint32_t tsum = mo.sum; 28 28 mo.id = me; 29 29 yield(random(5)); … … 36 36 37 37 thread LockCheck { 38 size_t sum;38 uint32_t sum; 39 39 }; 40 40 … … 50 50 51 51 int main() { 52 size_t sum = -32;52 uint32_t sum = -32; 53 53 mo.sum = -32; 54 54 processor p[2]; -
tests/unified_locking/timeout_lock.cfa
r82f4063 rbae0d35 1 1 #include <stdio.h> 2 #include "locks.hfa"3 #include "alarm.hfa"2 #include <locks.hfa> 3 #include <alarm.hfa> 4 4 #include <stdlib.hfa> 5 5 #include <thread.hfa> 6 #include "kernel.cfa"6 #include <kernel.hfa> 7 7 8 8 multiple_acquisition_lock m, n; … … 33 33 34 34 for ( unsigned int i = 0; i < NoOfTimes + 3; i += 1 ) { 35 if ( wait( c_m, m, 1000000`ns ) ) { 35 if ( wait( c_m, m, 1000000`ns ) ) { 36 36 // printf("Thread: %p signalled\n", active_thread()); // removed since can't expect non deterministic output 37 37 } else { … … 73 73 processor p[2]; 74 74 printf("Start Test 1: surface testing condition variable timeout routines\n"); 75 wait( c_m, 1`ns ); // bool wait( condition_variable(L) & this, Duration duration ); 75 wait( c_m, 1`ns ); // bool wait( condition_variable(L) & this, Duration duration ); 76 76 wait( c_m, 10, 1`ns ); // bool wait( condition_variable(L) & this, uintptr_t info, Duration duration ); 77 77 lock(m); wait( c_m, m, 1`ns ); unlock(m); // bool wait( condition_variable(L) & this, L & l, Duration duration );
Note:
See TracChangeset
for help on using the changeset viewer.