Ignore:
Timestamp:
Mar 2, 2020, 4:59:27 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dfa4360
Parents:
37cdd97
Message:

First draft implementation of generators, still missing error checking, testing and clean-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/coroutineThen.cfa

    r37cdd97 r427854b  
    4949
    5050void main(Coroutine& this) {
    51         suspend();
     51        suspend;
    5252        for(int i = 0; TEST(i < N); i++) {
    5353
    5454                print("C - Suspending");
    55                 void publish() {
     55                suspend{
    5656                        print("C - Publishing");
    5757                        assert(!the_cor);
    5858                        store( this );
    5959                }
    60                 suspend_then(publish);
    6160                assert(!the_cor);
    6261                print("Coroutine 2");
     
    6564        }
    6665        done = true;
    67         suspend();
     66        suspend;
    6867}
    6968
Note: See TracChangeset for help on using the changeset viewer.