Struct FileBasedLock
Implements file based locking that can help synchronize processes
struct FileBasedLock
;
Constructors
Name | Description |
---|---|
this
(file_name, file_dir, create_dir)
|
Creates a FileBasedLock object |
Fields
Name | Type | Description |
---|---|---|
file_name
|
string | |
file_path
|
string |
Methods
Name | Description |
---|---|
lockBlock
()
|
Attempts to lock the file and blocks until the lock is acquired |
lockThrow
()
|
Attempts to lock the file and throws exception if unsuccessful |
lockTry
()
|
Attempts to lock the file and return immediately |
unlock
()
|
Unlocks the file |