gem5.utils.filelock.html
gem5.utils.filelock module¶
- class gem5.utils.filelock.FileLock(file_name, timeout=10, delay=0.05)¶
Bases:
objectA file locking mechanism that has context-manager support so you can use it in a with statement. This should be relatively cross compatible as it doesn’t rely on
msvcrtorfcntlfor the locking.- acquire()¶
Acquire the lock, if possible. If the lock is in use, it check again every
waitseconds. It does this until it either gets the lock or exceedstimeoutnumber of seconds, in which case it throws an exception.
- release()¶
Get rid of the lock by deleting the lockfile.
When working in a
withstatement, this gets automatically called at the end.
- exception gem5.utils.filelock.FileLockException¶
Bases:
Exception