3 unit aSemaphore: process(node:integer);
6 return enable free disable pass;
10 return enable pass disable free;
26 writeln("koniec semafora");
29 unit writer: process (node:integer, nr:integer,s: string, sem: aSemaphore);
41 writeln("jestem w procesie ",nr);
42 for i := lower(a) to upper(a)
47 writeln("skonczyl",nr);
52 var s: aSemaphore, w1, w2: writer, i: integer;
54 begin s := new aSemaphore(0);
56 w1:= new writer(0,1,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",s);
57 w2:= new writer(0,2,"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", s);
58 writeln("press Enter");
65 writeln("polaczone procesy");