@@ -90,24 +90,29 @@ A <dfn export id=file>file entry</dfn> additionally consists of
90
90
a <dfn for="file entry">lock</dfn> (a string that may exclusively be "`open`", "`taken-exclusive`" or "`taken-shared`")
91
91
and a <dfn for="file entry">shared lock count</dfn> (a number representing the number shared locks that are taken at a given point in time).
92
92
93
+ The <dfn id="file-system-lock-queue">file system lock queue</dfn> is a
94
+ [=parallel queue=] to be used for all <a for=/>tasks</a> involving a
95
+ [=file entry/lock=] .
96
+
93
97
<div algorithm>
94
98
To <dfn for="file entry/lock">take</dfn> a [=file entry/lock=] with a |value| of "`exclusive`" or "`shared`" on a given [=file entry=] |file|:
95
99
96
100
1. Let |lock| be the |file|'s [=file entry/lock=] .
97
- 1. Let |count| be the |file|'s [=file entry/shared lock count=] .
98
- 1. If |value| is "`exclusive`":
99
- 1. If |lock| is "`open`":
100
- 1. Set lock to "`taken-exclusive`".
101
- 1. Return true.
102
- 1. If |value| is "`shared`":
103
- 1. If |lock| is "`open`":
104
- 1. Set |lock| to "`taken-shared`".
105
- 1. Set |count| to 1.
106
- 1. Return true.
107
- 1. Otherwise, if |lock| is "`taken-shared`":
108
- 1. Increase |count| by one.
109
- 1. Return true.
110
- 1. Return false.
101
+ 1. [=Enqueue the following steps=] to the [=file system lock queue=] :
102
+ 1. Let |count| be the |file|'s [=file entry/shared lock count=] .
103
+ 1. If |value| is "`exclusive`":
104
+ 1. If |lock| is "`open`":
105
+ 1. Set lock to "`taken-exclusive`".
106
+ 1. Return true.
107
+ 1. If |value| is "`shared`":
108
+ 1. If |lock| is "`open`":
109
+ 1. Set |lock| to "`taken-shared`".
110
+ 1. Set |count| to 1.
111
+ 1. Return true.
112
+ 1. Otherwise, if |lock| is "`taken-shared`":
113
+ 1. Increase |count| by one.
114
+ 1. Return true.
115
+ 1. Return false.
111
116
112
117
</div>
113
118
@@ -116,11 +121,12 @@ To <dfn for="file entry/lock">release</dfn> a [=file entry/lock=] on a given [=f
116
121
run these steps:
117
122
118
123
1. Let |lock| be the |file|'s associated [=file entry/lock=] .
119
- 1. Let |count| be the |file|'s [=file entry/shared lock count=] .
120
- 1. If |lock| is "`taken-shared`":
121
- 1. Decrease |count| by one.
122
- 1. If |count| is 0, set |lock| to "`open`".
123
- 1. Otherwise, set |lock| to "`open`".
124
+ 1. [=Enqueue the following steps=] to the [=file system lock queue=] :
125
+ 1. Let |count| be the |file|'s [=file entry/shared lock count=] .
126
+ 1. If |lock| is "`taken-shared`":
127
+ 1. Decrease |count| by one.
128
+ 1. If |count| is 0, set |lock| to "`open`".
129
+ 1. Otherwise, set |lock| to "`open`".
124
130
125
131
</div>
126
132
0 commit comments