- Timestamp:
- Jun 15, 2021, 11:34:45 AM (5 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4f1b8f3f
- Parents:
- b6749fd (diff), 07033ce (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
- Files:
-
- 2 added
- 2 edited
-
coroutine/fibonacci.cfa (modified) (1 diff)
-
device/.expect/cpu.txt (added)
-
device/cpu.cfa (added)
-
unified_locking/fast.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/coroutine/fibonacci.cfa
rb6749fd r6f8c46d 31 31 } 32 32 33 int next( Fibonacci & fib ) with( fib ) {34 resume( fib ); // restart last suspend35 return fn;36 }37 38 33 int main() { 39 34 Fibonacci f1, f2; 40 35 for ( 10 ) { // print N Fibonacci values 41 sout | next( f1 ) | next( f2 );36 sout | resume( f1 ).fn | resume( f2 ).fn; 42 37 } // for 43 38 } -
tests/unified_locking/fast.cfa
rb6749fd r6f8c46d 22 22 uint32_t cs() { 23 23 $thread * me = active_thread(); 24 uint32_t value = (uint32_t)me;24 uint32_t value; 25 25 lock(mo.l); 26 26 { … … 28 28 mo.id = me; 29 29 yield(random(5)); 30 value = ((uint32_t)random()) ^ ((uint32_t)me); 30 31 if(mo.id != me) sout | "Intruder!"; 31 32 mo.sum = tsum + value;
Note:
See TracChangeset
for help on using the changeset viewer.