tomoscan.utils.io.SharedLockPool

class tomoscan.utils.io.SharedLockPool

Bases: object

Allows to acquire locks identified by name (hashable type) recursively.

__init__()

Methods

__init__()

acquire(name)

acquire_context_creation(name, contextmngr, ...)

Acquire lock only during context creation.

Attributes

names

acquire_context_creation(name, contextmngr, *args, **kwargs)

Acquire lock only during context creation.

This can be used for example to protect the opening of a file but not hold the lock while the file is open.