Changeset 85acec94 for tests/coroutine/prodcons.c
- Timestamp:
- Dec 12, 2018, 3:48:10 PM (7 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/coroutine/prodcons.c
r90cfc16 r85acec94 10 10 // Created On : Mon Sep 18 12:23:39 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 18 12:55:10201813 // Update Count : 5 112 // Last Modified On : Tue Dec 11 21:58:25 2018 13 // Update Count : 52 14 14 // 15 15 … … 32 32 int p1 = random( 100 ); 33 33 int p2 = random( 100 ); 34 sout | p1 | " " | p2 | endl;34 sout | p1 | " " | p2; 35 35 int status = delivery( *c, p1, p2 ); 36 sout | " $" | money | endl;37 sout | status | endl;36 sout | " $" | money; 37 sout | status; 38 38 receipt += 1; 39 39 } 40 40 stop( *c ); 41 sout | "prod stops" | endl;41 sout | "prod stops"; 42 42 } 43 43 int payment( Prod & prod, int money ) { … … 68 68 int money = 1, receipt; 69 69 for ( ; ! done; ) { 70 sout | p1 | " " | p2 | endl;71 sout | " $" | money | endl;70 sout | p1 | " " | p2; 71 sout | " $" | money; 72 72 status += 1; 73 73 receipt = payment( *p, money ); 74 sout | " #" | receipt | endl;74 sout | " #" | receipt; 75 75 money += 1; 76 76 } 77 sout | "cons stops" | endl;77 sout | "cons stops"; 78 78 } 79 79 int delivery( Cons & cons, int p1, int p2 ) { … … 92 92 srandom( /* getpid() */ 103 ); // fixed seed for testing 93 93 start( prod, 5, cons ); 94 sout | "main stops" | endl;94 sout | "main stops"; 95 95 } 96 96
Note:
See TracChangeset
for help on using the changeset viewer.