portalocker.constants module

Locking constants

Lock types:

  • EXCLUSIVE exclusive lock

  • SHARED shared lock

Lock flags:

  • NON_BLOCKING non-blocking

Manually unlock, only needed internally

  • UNBLOCK unlock

portalocker.constants.LOCK_EX = 2

exclusive lock

portalocker.constants.LOCK_NB = 4

non-blocking

portalocker.constants.LOCK_SH = 1

shared lock

portalocker.constants.LOCK_UN = 8

unlock

class portalocker.constants.LockFlags(value)[source]

Bases: enum.IntFlag

An enumeration.

EXCLUSIVE = 2

exclusive lock

NON_BLOCKING = 4

non-blocking

SHARED = 1

shared lock

UNBLOCK = 8

unlock

__annotations__ = {}
__module__ = 'portalocker.constants'