b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/mutex.pyc
Size2.47 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sPdZddklZeddd�[ddklZdd
d��YZd S( sJMutual exclusion -- for use with module sched

A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocked while the queue is not empty,
the first queue entry is removed and its function(argument) pair called,
implying it now has the lock.

Of course, no multi-threading is implied -- hence the funny interface
for lock, where a function is called once the lock is aquired.
iÿÿÿÿ(twarnpy3ks/the mutex module has been removed in Python 3.0t
stackleveli(tdequetmutexcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCsd|_t�|_dS(s)Create a new mutex -- initially unlocked.iN(tlockedRtqueue(tself((s/usr/lib64/python2.6/mutex.pyt__init__s cCs|iS(s!Test the locked bit of the mutex.(R(R((s/usr/lib64/python2.6/mutex.pyttestscCs |ipd|_tStSdS(s[Atomic test-and-set -- grab the lock if it is not set,
return True if it succeeded.iN(RtTruetFalse(R((s/usr/lib64/python2.6/mutex.pyt
testandsets
 cCs5|i�o||�n|ii||f�dS(s¦Lock a mutex, call the function with supplied argument
when it is acquired. If the mutex is already locked, place
function and argument in the queue.N(R Rtappend(Rtfunctiontargument((s/usr/lib64/python2.6/mutex.pytlock's
cCs:|io#|ii�\}}||�n
d|_dS(s]Unlock a mutex. If the queue is not empty, call the next
function with its argument.iN(RtpopleftR(RR
R((s/usr/lib64/python2.6/mutex.pytunlock0s
(t__name__t
__module__RRR RR(((s/usr/lib64/python2.6/mutex.pyRs
   N((t__doc__twarningsRt collectionsRR(((s/usr/lib64/python2.6/mutex.pyt<module>
s