summaryrefslogtreecommitdiff
path: root/ext/fs/30_fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fs/30_fs.js')
-rw-r--r--ext/fs/30_fs.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index 9343b6ec4..aa7f345e5 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -766,6 +766,22 @@ class FsFile {
futimeSync(this.#rid, atime, mtime);
}
+ lockSync(exclusive = false) {
+ op_fs_flock_sync(this.#rid, exclusive);
+ }
+
+ async lock(exclusive = false) {
+ await op_fs_flock_async(this.#rid, exclusive);
+ }
+
+ unlockSync() {
+ op_fs_funlock_sync(this.#rid);
+ }
+
+ async unlock() {
+ await op_fs_funlock_async(this.#rid);
+ }
+
[SymbolDispose]() {
core.tryClose(this.#rid);
}