/opt/alt/python37/lib/python3.7/site-packages/beaker
Edit: /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyc (13933B)
Ñò
ø[c @ s† d Z d d k Z d d k Z d d k Z d d k Z y d d k Z Wn e j
o d d k Z n Xy e i ƒ e
Z Wn9 y d d k Z e
Z Wq¸ e j
o
e
Z q¸ Xn Xd d k l Z d d k l Z d d d d d g Z d e f d
„ ƒ YZ e i ƒ Z d „ Z d „ Z d
„ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( s¸ Synchronization functions.
File- and mutex-based mutual exclusion synchronizers are provided,
as well as a name-based mutex which locks within an application
based on a string name.
iÿÿÿÿN( t util( t LockErrort file_synchronizert mutex_synchronizert null_synchronizert NameLockt
_threadingc B sT e Z d Z e i ƒ Z d e f d „ ƒ YZ d e d „ Z
e d „ Z d „ Z
RS( sØ a proxy for an RLock object that is stored in a name based
registry.
Multiple threads can get a reference to the same RLock based on the
name alone, and synchronize operations related to that name.
t NLContainerc B s e Z d „ Z d „ Z RS( c C s- | o t i ƒ | _ n t i ƒ | _ d S( N( R t RLockt lockt Lock( t selft reentrant( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt __init__/ s c C s | i S( N( R ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt __call__5 s ( t __name__t
__module__R
R ( ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR . s c C sE | d j o t i | ƒ | _ n t i i | t i | ƒ | _ d S( N( t NoneR R t _lockt lockst get( R t
identifierR ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR
8 s
c C s | i ƒ i | ƒ S( N( R t acquire( R t wait( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR ? s c C s | i ƒ i ƒ d S( N( R t release( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR B s N( R R t __doc__R t WeakValuedRegistryR t objectR R t FalseR
t TrueR R ( ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR $ s
c K s t i | | f | | | S( N( t _synchronizerst sync_get( R t clst kwargs( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt
_synchronizerI s c K s4 t p
d | j o t | ƒ St | t | Sd S( Nt lock_dir( t has_flockR R" t FileSynchronizer( R R! ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR M s c K s t | t | S( N( R" t ConditionSynchronizer( R R! ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR T s c B sA e Z d Z e d „ Z d „ Z d „ Z d „ Z e Z e Z RS( sm A 'null' synchronizer, which provides the :class:`.SynchronizerImpl` interface
without any locking.
c C s t S( N( R ( R R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt acquire_write_lock] s c C s d S( N( ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt acquire_read_lock` s c C s d S( N( ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt release_write_lockc s c C s d S( N( ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt release_read_lockf s (
R R R R R' R( R) R* R R ( ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR X s t SynchronizerImplc B sœ e Z d Z d „ Z d e f d „ ƒ YZ d „ Z e e ƒ Z d „ Z e d „ Z
d „ Z e Z e d „ Z
e
Z d „ Z d
„ Z d „ Z d „ Z RS(
s_ Base class for a synchronization object that allows
multiple readers, single writers.
c C s t i ƒ | _ d S( N( R t ThreadLocalt _state( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR
q s t SyncStatec B s e Z d Z d „ Z RS( t reentrantcountt writingt readingc C s d | _ t | _ t | _ d S( Ni ( R/ R R0 R1 ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR
w s ( s reentrantcounts writings reading( R R t __slots__R
( ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR. t s c C sB | i i ƒ p! t i ƒ } | i i | ƒ | S| i i ƒ Sd S( N( R- t hasR+ R. t putR ( R t state( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR5 | s
c C sw | i } | i o t d ƒ ‚ n | i p t d ƒ ‚ n | i d j o | i ƒ t | _ n | i d 8_ d S( Ns lock is in writing states lock is not in reading statei ( R5 R0 R R1 R/ t do_release_read_lockR ( R R5 ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR* … s
c C s“ | i } | i o t d ƒ ‚ n | i d j o> | i | ƒ } | p | o | i d 7_ t | _ n | S| i o | i d 7_ t Sd S( Ns lock is in writing statei i ( R5 R0 R R/ t do_acquire_read_lockR R1 ( R R R5 t x( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR( “ s
c C sw | i } | i o t d ƒ ‚ n | i p t d ƒ ‚ n | i d j o | i ƒ t | _ n | i d 8_ d S( Ns lock is in reading states lock is not in writing statei ( R5 R1 R R0 R/ t do_release_write_lockR ( R R5 ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR) £ s
c C s“ | i } | i o t d ƒ ‚ n | i d j o> | i | ƒ } | p | o | i d 7_ t | _ n | S| i o | i d 7_ t Sd S( Ns lock is in reading statei i ( R5 R1 R R/ t do_acquire_write_lockR R0 ( R R R5 R8 ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR' ³ s
c C s
t ƒ ‚ d S( N( t NotImplementedError( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR6 Å s c C s
t ƒ ‚ d S( N( R; ( R R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR7 È s c C s
t ƒ ‚ d S( N( R; ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR9 Ë s c C s
t ƒ ‚ d S( N( R; ( R R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR: Î s ( R R R R
R R. R5 t propertyR* R R( R) R R' R R6 R7 R9 R: ( ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR+ l s R% c B sk e Z d Z d „ Z d „ Z e e ƒ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z RS(
s/ A synchronizer which locks using flock().
c C s t t | ƒ i ƒ t i ƒ | _ | d j o t i ƒ } n | } t i | | g d d ƒ| _
t i i
| i
ƒ | _ d S( Nt extensions .lock( t superR% R
R R, t _filedescriptorR t tempfilet
gettempdirt encoded_patht filenamet ost patht dirnameR# ( R R R# ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR
Ö s
c C s
| i i ƒ S( N( R? R ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt _filedescæ s c C s. t i i | i ƒ p t i | i ƒ n d S( N( RD RE t existsR# R t verify_directory( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt
_ensuredirê s c C sM | i } | d j o3 | i ƒ t i | i | ƒ } | i i | ƒ n | S( N( RG R RJ RD t openRC R? R4 ( R t modet filedescriptor( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyt _openî s
c C s’ | i t i t i Bƒ } | pW y" t i | t i t i Bƒ t SWqŽ t j
o" t i
| ƒ | i i ƒ t
SXn t i | t i ƒ t Sd S( N( RN RD t O_CREATt O_RDONLYt fcntlt flockt LOCK_SHt LOCK_NBR t IOErrort closeR? t removeR ( R R RM ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR7 ö s
c C s’ | i t i t i Bƒ } | pW y" t i | t i t i Bƒ t SWqŽ t j
o" t i
| ƒ | i i ƒ t
SXn t i | t i ƒ t Sd S( N( RN RD RO t O_WRONLYRQ RR t LOCK_EXRT R RU RV R? RW R ( R R RM ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR: s
c C s | i ƒ d S( N( t _release_all_locks( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR6 s c C s | i ƒ d S( N( RZ ( R ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyR9 s c C sK | i } | d j o1 t i | t i ƒ t i | ƒ | i i ƒ n d S( N( RG R RQ RR t LOCK_UNRD RV R? RW ( R RM ( ( sG /opt/alt/python37/lib/python3.7/site-packages/beaker/synchronization.pyRZ s
(
R R R R
RG R<