Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Widelec: array(0..4) of Semafor := (others => 1);
- Kelner : Semafor := 4;
- task Filozof(1..5) is
- end;
- task body Filozof is
- begin
- loop
- Rozmyslaj();
- Wait(Kelner);
- Wait(Widelec(Filozof’index));
- Wait(Widelec((Filozof’index + 1) mod 5));
- PosilSie();
- Signal(Widelec((Filozof’index + 1) mod 5));
- Signal(Widelec(Filozof’index));
- Signal(Kelner);
- end loop;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement