vault backup: 2025-04-02 23:30:03
This commit is contained in:
parent
6492d433d2
commit
d936a07908
2 changed files with 7 additions and 5 deletions
|
@ -3,12 +3,12 @@ GLOB_MUTEX and R_MUTEX semaphores init. at 1
|
|||
R a shared register init. at 0
|
||||
|
||||
begin_read() :=
|
||||
PRIO_MUTEX.down()
|
||||
PR_MUTEX.down()
|
||||
R_MUTEX.down()
|
||||
R++ # currently active readers
|
||||
if R = 1 then GLOB_MUTEX.down()
|
||||
R_MUTEX.up()
|
||||
PRIO_MUTEX.up()
|
||||
PR_MUTEX.up()
|
||||
return
|
||||
|
||||
end_read() :=
|
||||
|
@ -19,6 +19,7 @@ end_read() :=
|
|||
return
|
||||
|
||||
begin_write() :=
|
||||
PR_MUTEX.down()
|
||||
GLOB_MUTEX.down()
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue