Ignore:
Timestamp:
Jun 24, 2019, 10:30:47 AM (6 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:
84917e2
Parents:
3c6e417 (diff), 9e0a360 (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/concurrent/examples/gortn.cfa

    r3c6e417 r54dd994  
    1010// Created On       : Wed Feb 20 08:02:37 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 20 08:35:55 2019
    13 // Update Count     : 3
     12// Last Modified On : Fri Jun 21 08:25:03 2019
     13// Update Count     : 4
    1414//
    1515
     
    1818
    1919struct Msg { int i, j; };
    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; }
     20thread GoRtn { int i;  float f;  Msg m; };
     21void ^?{}( GoRtn & mutex ) {}
     22void mem1( GoRtn & mutex gortn, int i ) { gortn.i = i; }
     23void mem2( GoRtn & mutex gortn, float f ) { gortn.f = f; }
     24void mem3( GoRtn & mutex gortn, Msg m ) { gortn.m = m; }
    2525
    26 void main( Gortn & gortn ) with( gortn ) {
    27         for ( ;; ) {
     26void main( GoRtn & gortn ) with( gortn ) {
     27        for () {
    2828                waitfor( mem1, gortn ) sout | i;
    2929                or waitfor( mem2, gortn ) sout | f;
     
    3333}
    3434int main() {
    35         Gortn gortn;                                                                            // start thread
     35        GoRtn gortn;                                                                            // start thread
    3636        mem1( gortn, 0 );
    3737        mem2( gortn, 2.5 );
Note: See TracChangeset for help on using the changeset viewer.