@@ -124,31 +124,30 @@ Issue: We should consider having further normative restrictions on file names th
124124never be allowed using this API, rather than leaving it entirely up to underlying file
125125systems.
126126
127+ A <dfn>lock type</dfn> is a [=string=] that may exclusively be "`open`",
128+ "`exclusive`", or "`shared`".
129+
127130A <dfn export id=file>file entry</dfn> additionally consists of
128131<dfn for="file entry" export>binary data</dfn> (a [=byte sequence=] ), a
129132<dfn for="file entry">modification timestamp</dfn> (a number representing the number of milliseconds since the <a spec=FileAPI>Unix Epoch</a> ),
130- a <dfn for="file entry">lock</dfn> (a string that may exclusively be "`open`", "`taken-exclusive`" or "`taken-shared`")
133+ a <dfn for="file entry">lock</dfn> (a [=lock type=] ),
131134and a <dfn for="file entry">lock count</dfn> (a number representing the number of locks that are taken at a given point in time).
132135
133136A user agent has an associated <dfn>file system queue</dfn> which is the
134137result of [=starting a new parallel queue=] . This queue is to be used for all
135138file system operations.
136139
137140<div algorithm>
138- To <dfn for="file entry" id=file-entry-lock-take>take a lock</dfn> with a |value| of
139- "`exclusive`" or "`shared`" on a given [=file entry=] |file|:
141+ To <dfn for="file entry" id=file-entry-lock-take>take a lock</dfn> with a |lockType| (a [=lock type=] )
142+ on a given [=file entry=] |file|:
140143
144+ 1. [=Assert=] : |lockType| is not "`open`".
1411451. Let |lock| be the |file|'s [=file entry/lock=] .
1421461. Let |count| be the |file|'s [=file entry/lock count=] .
1431471. If |lock| is not "`open`":
144- 1. If |value | is "`exclusive`" or |lock| is "`taken-exclusive`" :
148+ 1. If |lockType | is "`exclusive`" or |lock| is not equal to |lockType| :
145149 1. Return "`failure`".
146- 1. If |value| is "`exclusive`":
147- 1. [=Assert=] : |lock| is "`open`".
148- 1. [=Assert=] : |count| is 0.
149- 1. Set |lock| to "`taken-exclusive`".
150- 1. Otherwise:
151- 1. Set |lock| to "`taken-shared`".
150+ 1. Set |lock| to |lockType|.
1521511. Increase |count| by 1.
1531521. Return "`success`".
154153
0 commit comments