diff --git a/Concurrent Systems/test/Untitled.md b/Concurrent Systems/test/Untitled.md index 3948923..01cf08d 100644 --- a/Concurrent Systems/test/Untitled.md +++ b/Concurrent Systems/test/Untitled.md @@ -73,8 +73,15 @@ operation end_write() := ``` CNT initalized to the value I want to initalize the semaphore +Condition S up() := if CNT < 0 then - + S.signal() + CNT++ + +down() := + CNT-- + if CNT < 0 then + S.wait() ``` \ No newline at end of file