SharedMutex

class SharedMutex[U]

Description

A mutex-protected data

Inheritance:

Members defined in SharedMutex (2 members)

__hash__

Identity based hash of the mutex. Suitable for use in global lock ordering.

lock

Acquire access to the protected data.

Methods

__hash__() → int

Identity based hash of the mutex. Suitable for use in global lock ordering.

lock() → syside.WriteLocked[syside.U]

Acquire access to the protected data.

This returns a context manager that ensures the lock is released at the end of the scope:

with mutex.lock() as data:
    ...

Used by