diff --git a/index.bs b/index.bs index 1ad40b1..3aa40a1 100644 --- a/index.bs +++ b/index.bs @@ -135,6 +135,9 @@ To take a [=file system entry/lock=] wit 1. Let |lock| be the |entry|'s [=file system entry/lock=]. 1. Let |count| be the |entry|'s [=file system entry/shared lock count=]. +1. Let |hasDescendantLock| be the result of [=file system entry/lock/checking for a descendant lock=] on |entry|. +1. If |hasDescendantLock| is true: + 1. Return "`failure`". 1. If |value| is "`exclusive`": 1. If |lock| is "`open`": 1. Set lock to "`taken-exclusive`". @@ -153,6 +156,24 @@ Note: These steps have to be run on the [=file system queue=]. +
+To check for a descendant lock on a given +[=/file system entry=] |entry|: + +1. Let |lock| be the |entry|'s [=file system entry/lock=]. +1. If |lock| is not "`open`": + 1. Return true. +1. If |entry| is a [=directory entry=]: + 1. [=set/For each=] |child| of |entry|'s [=directory entry/children=]: + 1. Let |hasDescendantLock| be the result of [=file system entry/lock/checking for a descendant lock=] on |child|. + 1. If |hasDescendantLock| is true: + 1. Return true. +1. Return false. + +Note: These steps have to be run on the [=file system queue=]. + +
+
To release a [=file system entry/lock=] on a given [=/file system entry=] |entry|: