1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[utils] Use flock instead of lockf (Fixes #3621)

This commit is contained in:
Philipp Hagemeister 2014-09-01 01:41:25 +02:00
parent c9cc0bf57b
commit 2582bebe06

View File

@ -1141,10 +1141,10 @@ def _unlock_file(f):
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):