Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type textFile = monitor;
- var N, actualN = 0 : Integer;
- var x : condition;
- var temp : Integer;
- procedure entry ENTER
- begin
- when actualN < N
- x.wait();
- actualN := actualN + i.ID;
- end;
- procedure entry LEAVE
- begin
- actualN := actualN - i.ID;
- x.signal();
- end;
- procedure process
- begin
- textFile.ENTER;
- // WORK ON FILE
- textFile.LEAVE;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement