Changeset 933f32f for tests/coroutine/pingpong.cfa
- Timestamp:
- May 24, 2019, 10:19:41 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d908563
- Parents:
- 6a9d4b4 (diff), 292642a (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
-
tests/coroutine/pingpong.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/coroutine/pingpong.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Sep 20 11:55:23 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 21:58:06 201813 // Update Count : 2912 // Last Modified On : Tue Mar 26 17:54:14 2019 13 // Update Count : 35 14 14 // 15 15 … … 20 20 const char * name; 21 21 /* const */ unsigned int N; 22 PingPong *part;22 PingPong & part; 23 23 }; 24 24 25 25 void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) { 26 (this.__cor){name}; 27 this.name = name; 28 this.N = N; 29 this.part = ∂ 26 this.[name, N] = [name, N]; &this.part = ∂ 30 27 } 31 28 void ?{}( PingPong & this, const char * name, unsigned int N ) { 32 this{ name, N, * (PingPong *)0 };29 this{ name, N, *0p }; // call first constructor 33 30 } 34 31 void cycle( PingPong & pingpong ) { … … 36 33 } 37 34 void partner( PingPong & this, PingPong & part ) { 38 this.part = ∂35 &this.part = ∂ 39 36 resume( this ); 40 37 } 41 void main( PingPong & pingpong ) {// ping's starter ::main, pong's starter ping42 for ( pingpong.N ) {// N ping-pongs43 sout | pingpong.name;44 cycle( *pingpong.part );38 void main( PingPong & pingpong ) with(pingpong) { // ping's starter ::main, pong's starter ping 39 for ( N ) { // N ping-pongs 40 sout | name; 41 cycle( part ); 45 42 } // for 46 43 } … … 53 50 // Local Variables: // 54 51 // tab-width: 4 // 55 // compile-command: "cfa pingpong.c " //52 // compile-command: "cfa pingpong.cfa" // 56 53 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.