- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/coroutineYield.c
r7bdcac1 ref952d7 5 5 #include <time> 6 6 7 #define __kick_rate 150000ul 7 8 #include "long_tests.h" 8 9 … … 25 26 void main(Coroutine& this) { 26 27 while(true) { 27 sout | "Coroutine 1" | endl; 28 #if !defined(TEST_FOREVER) 29 sout | "Coroutine 1" | endl; 30 #endif 28 31 yield(); 29 sout | "Coroutine 2" | endl; 32 #if !defined(TEST_FOREVER) 33 sout | "Coroutine 2" | endl; 34 #endif 30 35 suspend(); 31 36 } … … 36 41 Coroutine c; 37 42 for(int i = 0; TEST(i < N); i++) { 38 sout | "Thread 1" | endl; 43 #if !defined(TEST_FOREVER) 44 sout | "Thread 1" | endl; 45 #endif 39 46 resume(c); 40 sout | "Thread 2" | endl; 47 #if !defined(TEST_FOREVER) 48 sout | "Thread 2" | endl; 49 #endif 41 50 yield(); 42 51 KICK_WATCHDOG;
Note:
See TracChangeset
for help on using the changeset viewer.