|
| lock_file_path |
|
| wait_seconds |
|
| fd |
|
A primitive, file-based synchronization utility.
Definition at line 12 of file file_baton.py.
def torch.utils.file_baton.FileBaton.__init__ |
( |
|
self, |
|
|
|
lock_file_path, |
|
|
|
wait_seconds = 0.1 |
|
) |
| |
Creates a new :class:`FileBaton`.
Args:
lock_file_path: The path to the file used for locking.
wait_seconds: The seconds to periorically sleep (spin) when
calling ``wait()``.
Definition at line 15 of file file_baton.py.
def torch.utils.file_baton.FileBaton.release |
( |
|
self | ) |
|
Releaes the baton and removes its file.
Definition at line 51 of file file_baton.py.
def torch.utils.file_baton.FileBaton.try_acquire |
( |
|
self | ) |
|
Tries to atomically create a file under exclusive access.
Returns:
True if the file could be created, else False.
Definition at line 28 of file file_baton.py.
def torch.utils.file_baton.FileBaton.wait |
( |
|
self | ) |
|
Periodically sleeps for a certain amount until the baton is released.
The amount of time slept depends on the ``wait_seconds`` parameter
passed to the constructor.
Definition at line 41 of file file_baton.py.
The documentation for this class was generated from the following file: