vault backup: 2025-04-03 18:26:35
This commit is contained in:
parent
05b428be81
commit
1315545918
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue