scistag.common.mt.stag_lock.StagLock

class StagLock(thread_lock=True)[source]

Bases: object

Replacement for the standard multithreading. Can be configured for different use cases. Behaves like a standard RLock by default.

Usage: with my_lock() as lock:...

Parameters

thread_lock – Defines if a thread lock shall be used

Methods

acquire

Acquires this lock and prevents other users from accessing data it protects.

release

Releases the lock

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

acquire()[source]

Acquires this lock and prevents other users from accessing data it protects.

release()[source]

Releases the lock