Package entropy :: Module misc :: Class ReadersWritersSemaphore

Class ReadersWritersSemaphore

source code


A simple Readers Writers Lock object. Inspired by: http://code.activestate.com/recipes/ 577803-reader-writer-lock-with-priority-for-writers/ and by: Mateusz Kobos

Nested Classes
  SemaphoreWrapper
Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
reader_acquire(self)
Acquire the Reader end.
source code
 
try_reader_acquire(self)
Acquire the Reader end in non-blocking mode.
source code
 
reader_release(self)
Release the Reader end.
source code
 
writer_acquire(self)
Acquire the Writer end.
source code
 
try_writer_acquire(self)
Acquire the Writer end in non-blocking mode.
source code
 
writer_release(self)
Release Writer end.
source code
 
reader(*args, **kwds)
Acquire the Reader end.
source code
 
writer(*args, **kwds)
Acquire the Writer end.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

reader(*args, **kwds)

source code 

Acquire the Reader end.

Decorators:
  • @contextlib.contextmanager

writer(*args, **kwds)

source code 

Acquire the Writer end.

Decorators:
  • @contextlib.contextmanager