aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-07 14:43:49 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-07 14:43:49 +0100
commitfa436b5b0c557abf46d6dcc919c9c2271ddedfcc (patch)
treed89253a648df203a7a387040f219e4431accc7b3 /lib/private/files
parente5b5eca5a96acd2001fd72d1cbb290de53186be0 (diff)
parent02635c6f2fe9357c88aa896896aec036f92c8d87 (diff)
downloadnextcloud-server-fa436b5b0c557abf46d6dcc919c9c2271ddedfcc.tar.gz
nextcloud-server-fa436b5b0c557abf46d6dcc919c9c2271ddedfcc.zip
Merge pull request #22812 from owncloud/node-lock
Add locking to the node api
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/node/node.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/files/node/node.php b/lib/private/files/node/node.php
index 5df4f738a42..c4fabfc2e2e 100644
--- a/lib/private/files/node/node.php
+++ b/lib/private/files/node/node.php
@@ -356,4 +356,28 @@ class Node implements \OCP\Files\Node {
public function getChecksum() {
return;
}
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ * @throws \OCP\Lock\LockedException
+ */
+ public function lock($type) {
+ $this->view->lockFile($this->path, $type);
+ }
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ * @throws \OCP\Lock\LockedException
+ */
+ public function changeLock($type) {
+ $this->view->changeLock($this->path, $type);
+ }
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ * @throws \OCP\Lock\LockedException
+ */
+ public function unlock($type) {
+ $this->view->unlockFile($this->path, $type);
+ }
}