OBJECT Station (next: Station); 

  VAR {PRIVATE}
    in, out: INTEGER;
    buf: ARRAY N OF OBJECT;

  PROCEDURE {PRIVATE}  Get (VAR x: OBJECT); 
  BEGIN {LOCKED} 
    AWAIT (in # out); 
    x := buf[out];
    out := (out + 1) MOD N 
  END  Get;

  PROCEDURE {PUBLIC} Put (x: OBJECT); 
  BEGIN {LOCKED}
    AWAIT (in + 1) MOD N # out;
    buf[in] := x;
    in := (in + 1) MOD N
  END Put;

  ACTIVITY;
    VAR x: OBJECT;
  BEGIN 
    LOOP
      Get(x); (* далее должна идти обработка объекта x *)
      next.Put(x)
    END
  END

BEGIN
  in := 0; out := 0
END  Station.
508