Changeset 7323573 for src/tests/concurrent/coroutineYield.c
- Timestamp:
- Feb 6, 2018, 10:29:44 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 5f95b5f
- Parents:
- 82c948c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/coroutineYield.c
r82c948c r7323573 7 7 8 8 void main(Coroutine& this) { 9 sout | "Coroutine 1" | endl; 10 yield(); 11 sout | "Coroutine 2" | endl; 9 while(true) { 10 sout | "Coroutine 1" | endl; 11 yield(); 12 sout | "Coroutine 2" | endl; 13 suspend(); 14 } 12 15 } 13 16 … … 15 18 int main(int argc, char* argv[]) { 16 19 Coroutine c; 17 sout | "Thread 1" | endl; 18 resume(c); 19 sout | "Thread 2" | endl; 20 for(int i = 0; i < 1_000; i++) { 21 sout | "Thread 1" | endl; 22 resume(c); 23 sout | "Thread 2" | endl; 24 yield(); 25 } 20 26 }
Note: See TracChangeset
for help on using the changeset viewer.