%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/
Upload File :
Create Path :
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyc

�
�ac@s<ddlZdZddd��YZddd��YZdS(	i����Ns
Mateusz KobostRWLockcBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s
    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
    cCsIt�|_t�|_tj�|_tj�|_tj�|_dS(sz
        A lock giving an even higher priority to the writer in certain
        cases (see [2] for a discussion).
        N(t_LightSwitcht_RWLock__read_switcht_RWLock__write_switcht	threadingtLockt_RWLock__no_readerst_RWLock__no_writerst_RWLock__readers_queue(tself((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyt__init__$s
cCsK|jj�|jj�|jj|j�|jj�|jj�dS(N(RtacquireRRRtrelease(R	((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pytreader_acquire/s



cCs|jj|j�dS(N(RRR(R	((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pytreader_release6scCs$|jj|j�|jj�dS(N(RRRR(R	((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pytwriter_acquire9scCs$|jj�|jj|j�dS(N(RRRR(R	((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pytwriter_release=s
(t__name__t
__module__t__doc__R
R
RRR(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyRs				RcBs)eZdZd�Zd�Zd�ZRS(s�An 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).cCsd|_tj�|_dS(Ni(t_LightSwitch__counterRRt_LightSwitch__mutex(R	((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyR
Es	cCsI|jj�|jd7_|jdkr8|j�n|jj�dS(Ni(RRRR(R	tlock((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyRIs


cCsI|jj�|jd8_|jdkr8|j�n|jj�dS(Nii(RRRR(R	R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyRPs


(RRRR
RR(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyRBs		(((Rt
__author__RR(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/_rwlock.pyt<module>s7

Zerion Mini Shell 1.0