diff --git a/Concurrent Systems/test/Untitled.md b/Concurrent Systems/test/Untitled.md index 69c4ce0..3948923 100644 --- a/Concurrent Systems/test/Untitled.md +++ b/Concurrent Systems/test/Untitled.md @@ -57,9 +57,11 @@ operation begin_write() := CW.signal() # wakes eventually other waiting writers *they will return false* if (AR + AW != 0) then CW.wait() - if LASTW + if (LASTW != i) then + return false AW++ WW-- + return true operation end_write() := AW-- @@ -67,4 +69,12 @@ operation end_write() := CW.signal() else CR.signal() +``` + +``` +CNT initalized to the value I want to initalize the semaphore + +up() := + if CNT < 0 then + ``` \ No newline at end of file