summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Kendrick (monotony) <rjek@rjek.com>2012-08-11 17:28:11 +0100
committerRob Kendrick (monotony) <rjek@rjek.com>2012-08-11 17:28:11 +0100
commit4c354ca4f52a806105a355502e2db2d9b161976e (patch)
tree80dab944d1ad037876aeed44a23de287ad5e5109
parent9f2f8c34f17d60ef943bf78edc8e26a95afa3fea (diff)
downloadluxio-4c354ca4f52a806105a355502e2db2d9b161976e.tar.gz
simple: unlock wrapper too
-rw-r--r--luxio/simple.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/luxio/simple.lua b/luxio/simple.lua
index 8040e6b..739004c 100644
--- a/luxio/simple.lua
+++ b/luxio/simple.lua
@@ -78,6 +78,9 @@
-- wait until the lock is available before claiming it and
-- returning.
--
+-- myfile:unlock(whence, start, len)
+-- Same as above, except implicitly passes "" on your behave in mode
+--
-- myfile:locktest(mode, whence, start, len)
-- As above, but it does not claim the lock, just checks if it
-- is available. Returns true if the lock would work, or false
@@ -639,6 +642,10 @@ local function lock(o, rw, whence, offset, len, wait, test)
end
end
+local function unlock(o, whence, offset, len)
+ return lock(o, "", whence, offset, len)
+end
+
local function locktest(o, type, whence, offset, len)
return lock(o, type, whence, offset, len, false, true)
end