How to use the aiorwlock._RWLockCore function in aiorwlock

To help you get started, we’ve selected a few aiorwlock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freenas / freenas / src / middlewared / middlewared / plugins / View on Github external
            for dataset in datasets
            if (directory + "/").startswith(dataset["mountpoint"] + "/")
        key=lambda dataset: dataset["prefixlen"],

    return dataset, any(
        (ds["mountpoint"] + "/").startswith(directory + "/")
        for ds in datasets
        if ds != dataset

class _FsLockCore(aiorwlock._RWLockCore):
    def _release(self, lock_type):
        if self._r_state == 0 and self._w_state == 0:

        return super()._release(lock_type)

class _FsLock(aiorwlock.RWLock):
    core = _FsLockCore

class FsLockDirection(enum.Enum):
    READ = 0
    WRITE = 1


Read write lock for asyncio.

Latest version published 5 months ago

Package Health Score

85 / 100
Full package analysis

Similar packages