Server : Apache System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : andertr9 ( 1047) PHP Version : 8.2.18 Disable Function : NONE Directory : /lib64/python2.7/ |
Upload File : |
� m��fc @ sP d Z d d l m Z e d d d �[ d d l m Z d d d � � YZ d S( sJ Mutual 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����( t warnpy3ks/ the mutex module has been removed in Python 3.0t stackleveli ( t dequet mutexc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C s t | _ t � | _ d S( s) Create a new mutex -- initially unlocked.N( t Falset lockedR t queue( t self( ( s /usr/lib64/python2.7/mutex.pyt __init__ s c C s | j S( s! Test the locked bit of the mutex.( R ( R ( ( s /usr/lib64/python2.7/mutex.pyt test s c C s | j s t | _ t St Sd S( s[ Atomic test-and-set -- grab the lock if it is not set, return True if it succeeded.N( R t TrueR ( R ( ( s /usr/lib64/python2.7/mutex.pyt testandset s c C s3 | j � r | | � n | j j | | f � d S( 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 R t append( R t functiont argument( ( s /usr/lib64/python2.7/mutex.pyt lock'