Locks¶
-
class
uwsgiconf.options.locks.
Locks
(*args, **kwargs)¶ Locks.
-
set_basic_params
(*, count: int = None, thunder_lock: bool = None, lock_engine: str = None)¶ Parameters: - count – Create the specified number of shared locks.
- thunder_lock –
Serialize accept() usage (if possible) Could improve performance on Linux with robust pthread mutexes.
http://uwsgi.readthedocs.io/en/latest/articles/SerializingAccept.html
- lock_engine –
Set the lock engine.
- Example:
- ipcsem
-
set_ipcsem_params
(*, ftok: str = None, persistent: bool = None)¶ Sets ipcsem lock engine params.
Parameters: - ftok – Set the ipcsem key via ftok() for avoiding duplicates.
- persistent – Do not remove ipcsem’s on shutdown.
-
lock_file
(fpath: Union[str, pathlib.Path], *, after_setup: bool = False, wait: bool = False)¶ Locks the specified file.
Parameters: - fpath – File path.
- after_setup – True - after logging/daemon setup False - before starting
- wait – True - wait if locked False - exit if locked
-