/usr/lib64/python2.6/Demo/metaclasses
NameSizeModeActions
Eiffel.py34680644editdlrm
Eiffel.pyc46430644editdlrm
Eiffel.pyo45400644editdlrm
Enum.py44190644editdlrm
Enum.pyc61990644editdlrm
Enum.pyo61990644editdlrm
index.html205750644editdlrm
meta-vladimir.txt115270644editdlrm
Meta.py29330644editdlrm
Meta.pyc46010644editdlrm
Meta.pyo46010644editdlrm
Simple.py11920644editdlrm
Simple.pyc27500644editdlrm
Simple.pyo27500644editdlrm
Synch.py79380644editdlrm
Synch.pyc85060644editdlrm
Synch.pyo83480644editdlrm
Trace.py41330644editdlrm
Trace.pyc61920644editdlrm
Trace.pyo61920644editdlrm
Edit: /usr/lib64/python2.6/Demo/metaclasses/Synch.pyc (8506B)
Ñò «gc@sÊdZddkZddd„ƒYZd„ZddklZlZlZdefd„ƒYZd efd „ƒYZ d efd „ƒYZ e d dhƒZ d„Z e djoeƒe ƒndS(s`Synchronization metaclass. This metaclass makes it possible to declare synchronized methods. iÿÿÿÿNtLockcBs,eZdZd„Zdd„Zd„ZRS(s Reentrant lock. This is a mutex-like object which can be acquired by the same thread more than once. It keeps a reference count of the number of times it has been acquired by the same thread. Each acquire() call must be matched by a release() call and only the last release() call actually releases the lock for acquisition by another thread. The implementation uses two locks internally: __mutex is a short term lock used to protect the instance variables __wait is the lock for which other threads wait A thread intending to acquire both locks should acquire __wait first. The implementation uses two other instance variables, protected by locking __mutex: __tid is the thread ID of the thread that currently has the lock __count is the number of times the current thread has acquired it When the lock is released, __tid is None and __count is zero. cCs4tiƒ|_tiƒ|_d|_d|_dS(s0Constructor. Initialize all instance variables.iN(tthreadt allocate_lockt _Lock__mutext _Lock__waittNonet _Lock__tidt _Lock__count(tself((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyt__init__*s icCsä|iiƒz/|itiƒjo|id|_dSWd|iiƒX|ii|ƒ}| o | odSz[|iiƒ|idjpt ‚|idjpt ‚tiƒ|_d|_dSWd|iiƒXdS(s}Acquire the lock. If the optional flag argument is false, returns immediately when it cannot acquire the __wait lock without blocking (it may still block for a little while in order to acquire the __mutex lock). The return value is only relevant when the flag argument is false; it is 1 if the lock is acquired, 0 if not. iNi( RtacquireRRt get_identRtreleaseRRtAssertionError(Rtflagtlocked((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR 1s"    cCs”|iiƒzr|itiƒjpt‚|idjpt‚|id|_|idjod|_|ii ƒnWd|ii ƒXdS(sìRelease the lock. If this thread doesn't currently have the lock, an assertion error is raised. Only allow another thread to acquire the lock when the count reaches zero after decrementing it. iiN( RR RRR R RRRR (R((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR Qs  (t__name__t __module__t__doc__R R R (((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR s  cCsùg}|d„}||d„}tƒ}|iƒ||ƒ|iƒ|iƒti||fƒti|||fƒti||fƒti||fƒ|iƒddk}x0t|ƒdjot|ƒGH|idƒqºWt|ƒGHdS(NcSs3|iƒdtiƒG|iƒ|idƒdS(Nsf2 running in thread %d i(R RR R tappend(tlocktdone((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pytf2ks  cSsE|iƒdtiƒGz||ƒWd|iƒX|idƒdS(Nsf1 running in thread %d i(R RR R R(RRR((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pytf1qs   iÿÿÿÿi gü©ñÒMbP?(RR R Rtstart_new_threadttimetlentsleep(RRRRR((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyt _testLockgs&         (t MetaClasst MetaHelpertMetaMethodWrappertLockingMethodWrappercBseZd„ZRS(c Os|id djo2|iddjot|i|if||ƒS|iiiƒz!t|i|if||ƒSWd|iiiƒXdS(Nit_(Rtapplytfunctinstt__lock__R R (Rtargstkw((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyt__call__•s (!(RRR((((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR ”st LockingHelpercBseZeZd„ZRS(cCs ti||ƒtƒ|_dS(N(Rt__helperinit__RR%(Rt formalclass((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR* s(RRR t__methodwrapper__R*(((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR)žstLockingMetaClasscBseZeZRS((RRR)t __helper__(((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR-¤stLockingcCsÒdtfd„ƒY}dd„}dd„}tiƒ}|iƒtiƒ}|iƒ|dƒ}d}ti||||fƒti||||fƒ|iƒdGH|iƒdGHd Gt|iƒGHdS( NtBuffercBs#eZd„Zd„Zd„ZRS(cSsD|djpt‚||_dg|i|_d|_|_dS(Ni(R tsizeRtbuffertfirsttlast(Rt initialsize((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR ¬s cSsM|id|i|ijo,||i|i<|id|i|_dSdG|iGHd|i|i|ifGH|i|ijo|i|i|i!}n|i|i|i|i }dG|GH|dg|id|_d|_|id|_|id|_dG|iGHdG|iGHd|i|i|ifGH|i|ƒdS( Nisbuffer =s first = %d, last = %d, size = %dstemp =iisBuffer size doubled tos new buffer =(R4R1R3R2Rtput(Rtitemttemp((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR6±s(     cSsH|i|ijo t‚n|i|i}|id|i|_|S(Ni(R3R4tEOFErrorR2R1(RR7((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pytgetËs  (RRR R6R:(((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyR0«s  iècSsbddk}d}x2||jo$dG|GH|i|ƒ|d}qWdG|GdGH|iƒdS(NiÿÿÿÿiR6isProducer: done producingtitems(RR6R (R2twaittnRti((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pytproducerÓs     cSsÂddk}d}d}xŒ||jo~yM|iƒ}||jotd||f‚ndG|GH|d}d}Wqtj o|i|ƒ|d}qXqWdG|Gd GH|iƒdS( Niÿÿÿÿigü©ñÒMbP?sget() returned %s, expected %stgotiisConsumer: done consumingR;(RR:R R9RR (R2R<R=RR>ttouttx((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pytconsumerÝs$         is Producer donesAll donesbuffer size ==(R/RRR RRR2(R0R?RCtpwaittcwaitR2R=((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyt_test©s (        t__main__(((RRRRtMetaRRRR R)R-R/RFR(((s./usr/lib64/python2.6/Demo/metaclasses/Synch.pyts Z +  U