Ignore:
Timestamp:
Dec 12, 2018, 3:48:10 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
515a037
Parents:
90cfc16 (diff), 5ebb1368 (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 branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/prodcons.c

    r90cfc16 r85acec94  
    1010// Created On       : Mon Sep 18 12:23:39 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 12:55:10 2018
    13 // Update Count     : 51
     12// Last Modified On : Tue Dec 11 21:58:25 2018
     13// Update Count     : 52
    1414//
    1515
     
    3232                int p1 = random( 100 );
    3333                int p2 = random( 100 );
    34                 sout | p1 | " " | p2 | endl;
     34                sout | p1 | " " | p2;
    3535                int status = delivery( *c, p1, p2 );
    36                 sout | " $" | money | endl;
    37                 sout | status | endl;
     36                sout | " $" | money;
     37                sout | status;
    3838                receipt += 1;
    3939        }
    4040        stop( *c );
    41         sout | "prod stops" | endl;
     41        sout | "prod stops";
    4242}
    4343int payment( Prod & prod, int money ) {
     
    6868        int money = 1, receipt;
    6969        for ( ; ! done; ) {
    70                 sout | p1 | " " | p2 | endl;
    71                 sout | " $" | money | endl;
     70                sout | p1 | " " | p2;
     71                sout | " $" | money;
    7272                status += 1;
    7373                receipt = payment( *p, money );
    74                 sout | " #" | receipt | endl;
     74                sout | " #" | receipt;
    7575                money += 1;
    7676        }
    77         sout | "cons stops" | endl;
     77        sout | "cons stops";
    7878}
    7979int delivery( Cons & cons, int p1, int p2 ) {
     
    9292        srandom( /* getpid() */ 103 );                                          // fixed seed for testing
    9393        start( prod, 5, cons );
    94         sout | "main stops" | endl;
     94        sout | "main stops";
    9595}
    9696
Note: See TracChangeset for help on using the changeset viewer.