Module locks
source code
|
|
_close_fds()
This is intended to be called after a fork, in order to close file
descriptors for locks held by the parent process. |
source code
|
|
|
|
|
|
|
|
|
|
lockfile(mypath,
wantnewlockfile=0,
unlinkfile=0,
waiting_msg=None,
flags=0)
If wantnewlockfile is True then this creates a lockfile in the parent
directory as the file: '.' + basename + '.portage_lockfile'. |
source code
|
|
|
Integer
|
|
|
|
|
|
|
|
|
|
|
|
|
hardlink_lockfile(lockfilename,
max_wait=<type 'exceptions.DeprecationWarning'>,
waiting_msg=None,
flags=0)
Does the NFS, hardlink shuffle to ensure locking on the disk. |
source code
|
|
|
|
| unhardlink_lockfile(lockfilename,
unlinkfile=True) |
source code
|
|
|
|
| hardlock_cleanup(path,
remove_all_locks=False) |
source code
|
|
|
|
HARDLINK_FD = -2
|
|
|
_HARDLINK_POLL_LATENCY = 3
|
|
|
_quiet = False
|
|
|
_open_fds = set([])
|
|
|
__package__ = 'portage'
|
Imports:
errno,
fcntl,
platform,
sys,
time,
warnings,
portage,
os,
_encodings,
_unicode_decode,
DirectoryNotFound,
FileNotFound,
InvalidData,
TryAgain,
OperationNotPermitted,
PermissionDenied,
portage_gid,
writemsg,
_,
_default_lock_fn
|
This is intended to be called after a fork, in order to close file
descriptors for locks held by the parent process. This can be called
safely after a fork without exec, unlike the _setup_pipes close_fds
behavior.
|
- Parameters:
fd (Integer) - an open file descriptor
- Returns: Integer
- the current number of hardlinks to the file
|
hardlink_lockfile(lockfilename,
max_wait=<type 'exceptions.DeprecationWarning'>,
waiting_msg=None,
flags=0)
| source code
|
Does the NFS, hardlink shuffle to ensure locking on the disk. We
create a PRIVATE hardlink to the real lockfile, that is just a
placeholder on the disk. If our file can 2 references, then we have the
lock. :) Otherwise we lather, rise, and repeat.
|