Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβthe ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβembodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.
Current path: lib64/python2.7/
β Cloned to:
β¬οΈ Go up: /lib64
οΏ½
zfc @ sP d Z d d l m Z e d d d οΏ½[ d d l m Z d d
d οΏ½ οΏ½ YZ d S( sK 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 acquired.
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'