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