On 7 February 2013 09:17, Sebastien Estienne
You could use fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) which
would raise an exception. You could then wrap this in a while loop if
you wanted to replicate the blocking behaviour using something along
the lines of:
while True:
try:
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
except OSError:
gevent.sleep(0.1) # arbitrary number