Changeset 49dee5e
- Timestamp:
- Jun 21, 2019, 11:47:48 AM (5 years ago)
- 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:
- 8d61d620, dc33b5b
- Parents:
- 3aa1d22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/examples/gortn.cfa
r3aa1d22 r49dee5e 10 10 // Created On : Wed Feb 20 08:02:37 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 08:35:55201913 // Update Count : 312 // Last Modified On : Fri Jun 21 08:25:03 2019 13 // Update Count : 4 14 14 // 15 15 … … 18 18 19 19 struct Msg { int i, j; }; 20 thread Go rtn { int i; float f; Msg m; };21 void ^?{}( Go rtn & mutex ) {}22 void mem1( Go rtn & mutex gortn, int i ) { gortn.i = i; }23 void mem2( Go rtn & mutex gortn, float f ) { gortn.f = f; }24 void mem3( Go rtn & mutex gortn, Msg m ) { gortn.m = m; }20 thread GoRtn { int i; float f; Msg m; }; 21 void ^?{}( GoRtn & mutex ) {} 22 void mem1( GoRtn & mutex gortn, int i ) { gortn.i = i; } 23 void mem2( GoRtn & mutex gortn, float f ) { gortn.f = f; } 24 void mem3( GoRtn & mutex gortn, Msg m ) { gortn.m = m; } 25 25 26 void main( Go rtn & gortn ) with( gortn ) {27 for ( ;;) {26 void main( GoRtn & gortn ) with( gortn ) { 27 for () { 28 28 waitfor( mem1, gortn ) sout | i; 29 29 or waitfor( mem2, gortn ) sout | f; … … 33 33 } 34 34 int main() { 35 Go rtn gortn; // start thread35 GoRtn gortn; // start thread 36 36 mem1( gortn, 0 ); 37 37 mem2( gortn, 2.5 );
Note: See TracChangeset
for help on using the changeset viewer.