+
    @i!                     :    ^ RI t Rt ! R R4      t ! R R4      tR# )    NzMateusz Kobosc                   B   a  ] tR t^t o RtR tR tR tR tR t	Rt
V tR# )	RWLocka  
Read-Write locking primitive

Synchronization object used in a solution of so-called second
readers-writers problem. In this problem, many readers can simultaneously
access a share, and a writer has an exclusive access to this share.
Additionally, the following constraints should be met:
1) no reader should be kept waiting if the share is currently opened for
   reading unless a writer is also waiting for the share,
2) no writer should be kept waiting for the share longer than absolutely
   necessary.

The implementation is based on [1, secs. 4.2.2, 4.2.6, 4.2.7]
with a modification -- adding an additional lock (C{self.__readers_queue})
-- in accordance with [2].

Sources:
[1] A.B. Downey: "The little book of semaphores", Version 2.1.5, 2008
[2] P.J. Courtois, F. Heymans, D.L. Parnas:
    "Concurrent Control with 'Readers' and 'Writers'",
    Communications of the ACM, 1971 (via [3])
[3] http://en.wikipedia.org/wiki/Readers-writers_problem
c                    \        4       V n        \        4       V n        \        P                  ! 4       V n        \        P                  ! 4       V n        \        P                  ! 4       V n        R# )zb
A lock giving an even higher priority to the writer in certain
cases (see [2] for a discussion).
N)_LightSwitch_RWLock__read_switch_RWLock__write_switch	threadingLock_RWLock__no_readers_RWLock__no_writers_RWLock__readers_queueselfs   &K/var/www/html/photoedit/myenv/lib/python3.14/site-packages/ecdsa/_rwlock.py__init__RWLock.__init__$   sE    
 *^*n%NN,%NN,(~~/    c                    V P                   P                  4        V P                  P                  4        V P                  P                  V P                  4       V P                  P                  4        V P                   P                  4        R # N)r   acquirer   r   r   releaser   s   &r   reader_acquireRWLock.reader_acquire/   sd    $$&!!#""4#4#45!!#$$&r   c                P    V P                   P                  V P                  4       R # r   )r   r   r   r   s   &r   reader_releaseRWLock.reader_release6   s    ""4#4#45r   c                    V P                   P                  V P                  4       V P                  P                  4        R # r   )r   r   r   r   r   s   &r   writer_acquireRWLock.writer_acquire9   s.    ##D$5$56!!#r   c                    V P                   P                  4        V P                  P                  V P                  4       R # r   )r   r   r   r   r   s   &r   writer_releaseRWLock.writer_release=   s.    !!###D$5$56r   )__no_readers__no_writers__read_switch__readers_queue__write_switchN)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r!   __static_attributes____classdictcell____classdict__s   @r   r   r      s(     0	0'6$7 7r   r   c                   6   a  ] tR t^Bt o RtR tR tR tRtV t	R# )r   zAn auxiliary "light switch"-like object. The first thread turns on the
"switch", the last one turns it off (see [1, sec. 4.2.2] for details).c                H    ^ V n         \        P                  ! 4       V n        R# )r   N)_LightSwitch__counterr	   r
   _LightSwitch__mutexr   s   &r   r   _LightSwitch.__init__F   s     ~~'r   c                    V P                   P                  4        V ;P                  ^,          un        V P                  ^8X  d   VP                  4        V P                   P                  4        R#    Nr4   r   r3   r   r   locks   &&r   r   _LightSwitch.acquireJ   E    !>>QLLNr   c                    V P                   P                  4        V ;P                  ^,          un        V P                  ^ 8X  d   VP                  4        V P                   P                  4        R# r7   r9   r:   s   &&r   r   _LightSwitch.releaseQ   r=   r   )	__counter__mutexN)
r(   r)   r*   r+   r,   r   r   r   r-   r.   r/   s   @r   r   r   B   s     N( r   r   )r	   
__author__r   r    r   r   <module>rD      s&   
  
47 47n r   