Skip to content

Commit 4eed3ec

Browse files
fuse: add thread/async safety warning
1 parent 646f279 commit 4eed3ec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/borg/fuse.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
"""
2+
FUSE filesystem implementation for `borg mount`.
3+
4+
IMPORTANT
5+
=========
6+
7+
This code is only safe for single-threaded and synchronous (non-async) usage.
8+
9+
- llfuse is synchronous and used with workers=1, so there is only 1 thread,
10+
and we are safe.
11+
- pyfuse3 uses Trio, which only uses 1 thread, but could use this code in an
12+
asynchronous manner. However, as long as we do not use any asynchronous
13+
operations (like using "await") in this code, it is still de facto
14+
synchronous, and we are safe.
15+
"""
116
import errno
217
import functools
318
import io

0 commit comments

Comments
 (0)