Ignore:
Timestamp:
Jun 29, 2018, 4:14:15 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env
Children:
184557e
Parents:
97397a26 (diff), 28f3a19 (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.
Message:

Merge remote-tracking branch 'origin/with_gc' into new-env

File:
1 edited

Legend:

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

    r97397a26 rb21c77a  
    44#include <thread>
    55#include <time>
     6
     7#define __kick_rate 150000ul
     8#include "long_tests.h"
    69
    710#ifndef PREEMPTION_RATE
     
    1316}
    1417
    15 #ifdef LONG_TEST
     18#ifdef TEST_LONG
    1619static const unsigned long N = 600_000ul;
    1720#else
     
    2326void main(Coroutine& this) {
    2427        while(true) {
    25                 sout | "Coroutine 1" | endl;
     28                #if !defined(TEST_FOREVER)
     29                        sout | "Coroutine 1" | endl;
     30                #endif
    2631                yield();
    27                 sout | "Coroutine 2" | endl;
     32                #if !defined(TEST_FOREVER)
     33                        sout | "Coroutine 2" | endl;
     34                #endif
    2835                suspend();
    2936        }
     
    3340int main(int argc, char* argv[]) {
    3441        Coroutine c;
    35         for(int i = 0; i < N; i++) {
    36                 sout | "Thread 1" | endl;
     42        for(int i = 0; TEST(i < N); i++) {
     43                #if !defined(TEST_FOREVER)
     44                        sout | "Thread 1" | endl;
     45                #endif
    3746                resume(c);
    38                 sout | "Thread 2" | endl;
     47                #if !defined(TEST_FOREVER)
     48                        sout | "Thread 2" | endl;
     49                #endif
    3950                yield();
     51                KICK_WATCHDOG;
    4052        }
    4153}
Note: See TracChangeset for help on using the changeset viewer.