Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/concurrent/coroutineYield.c

    ref952d7 rb9da9585  
    44#include <thread>
    55#include <time>
    6 
    7 #define __kick_rate 150000ul
    8 #include "long_tests.h"
    96
    107#ifndef PREEMPTION_RATE
     
    1613}
    1714
    18 #ifdef TEST_LONG
     15#ifdef LONG_TEST
    1916static const unsigned long N = 600_000ul;
    2017#else
     
    2623void main(Coroutine& this) {
    2724        while(true) {
    28                 #if !defined(TEST_FOREVER)
    29                         sout | "Coroutine 1" | endl;
    30                 #endif
     25                sout | "Coroutine 1" | endl;
    3126                yield();
    32                 #if !defined(TEST_FOREVER)
    33                         sout | "Coroutine 2" | endl;
    34                 #endif
     27                sout | "Coroutine 2" | endl;
    3528                suspend();
    3629        }
     
    4033int main(int argc, char* argv[]) {
    4134        Coroutine c;
    42         for(int i = 0; TEST(i < N); i++) {
    43                 #if !defined(TEST_FOREVER)
    44                         sout | "Thread 1" | endl;
    45                 #endif
     35        for(int i = 0; i < N; i++) {
     36                sout | "Thread 1" | endl;
    4637                resume(c);
    47                 #if !defined(TEST_FOREVER)
    48                         sout | "Thread 2" | endl;
    49                 #endif
     38                sout | "Thread 2" | endl;
    5039                yield();
    51                 KICK_WATCHDOG;
    5240        }
    5341}
Note: See TracChangeset for help on using the changeset viewer.