Viewing File: /opt/alt/python35/lib/python3.5/site-packages/lockfile/__pycache__/linklockfile.cpython-35.pyc



UV\
@spddlmZddlZddlZddlmZmZmZmZm	Z	m
Z
GdddeZdS))absolute_importN)LockBase
LockFailed	NotLocked	NotMyLockLockTimeout
AlreadyLockedc@sUeZdZdZdddZddZddZd	d
ZddZdS)
LinkLockFilezLock access to a file using atomic property of link(2).

    >>> lock = LinkLockFile('somefile')
    >>> lock = LinkLockFile('somefile', threaded=False)
    NcCstyt|jdjWn%tk
rAtd|jYnX|dk	rT|n|j}tj}|dk	r|dkr||7}xytj|j|j	Wnt
k
rgtj|jj}|dkrdS|dk	r@tj|kr@tj
|j|dkr-td|jntd|jtj|dk	r\|dp_dYqXdSqWdS)	Nwbzfailed to create %srz&Timeout waiting to acquire lock for %sz%s is already locked
g?)openunique_namecloseIOErrorrtimeouttimeoslink	lock_fileOSErrorstatst_nlinkunlinkrpathr	sleep)selfrend_timeZnlinksr/linklockfile.pyacquires0



(zLinkLockFile.acquirecCsn|js"td|jn(tjj|jsJtd|jtj|jtj|jdS)Nz%s is not lockedz%s is locked, but not by me)		is_lockedrrrexistsrrrr)rrrr release7szLinkLockFile.releasecCstjj|jS)N)rrr#r)rrrr r"?szLinkLockFile.is_lockedcCs:|jo9tjj|jo9tj|jjdkS)Nr)r"rrr#rrr)rrrr i_am_lockingBszLinkLockFile.i_am_lockingcCs)tjj|jr%tj|jdS)N)rrr#rr)rrrr 
break_lockGszLinkLockFile.break_lock)	__name__
__module____qualname____doc__r!r$r"r%r&rrrr r

s&r
)Z
__future__rrrrrrrrr	r
rrrr <module>s.
Back to Directory File Manager