mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-24 15:50:26 +01:00
[utils] Use flock instead of lockf (Fixes #3621)
This commit is contained in:
parent
c9cc0bf57b
commit
2582bebe06
@ -1141,10 +1141,10 @@ else:
|
||||
import fcntl
|
||||
|
||||
def _lock_file(f, exclusive):
|
||||
fcntl.lockf(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
|
||||
fcntl.flock(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
|
||||
|
||||
def _unlock_file(f):
|
||||
fcntl.lockf(f, fcntl.LOCK_UN)
|
||||
fcntl.flock(f, fcntl.LOCK_UN)
|
||||
|
||||
|
||||
class locked_file(object):
|
||||
|
Loading…
Reference in New Issue
Block a user