Changeset 4098


Ignore:
Timestamp:
Nov 11, 2009, 10:48:24 PM (11 years ago)
Author:
orlov
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/samples/src/ParCounter.rf

    r4097 r4098  
    55$use Arithm Box Parallel StdIO System;
    66
    7 $func NewCounter = t.counter;
    8 $func Incr t.counter = ;
    9 $func Count t.counter = s.n;
     7$public $func NewCounter = t.counter;
     8$public $func Incr t.counter = ;
     9$public $func Count t.counter = s.n;
    1010
    1111NewCounter =
     
    1818        $iter {
    1919                <Recv s.msgbox> : e,
    20                         <AtomicApply &UpdateCounter s.box> : e;
     20                        <Box.Get s.box> : s.n,
     21                        <Box.Store s.box <Add s.n 1>>;
    2122        }, $fail;
    22 
    23 $func UpdateCounter s.box = ;
    24 UpdateCounter s.box =
    25         <Box.Get s.box> : s.n,
    26         <Box.Store s.box <Add s.n 1>>;
    2723
    2824Incr (s.msgbox s.box) = <Send s.msgbox 1>;
Note: See TracChangeset for help on using the changeset viewer.