Bump version number to 2.4.2 to pick up the latest minor bug fixes.
[python/dscho.git] / Lib / lib-old / lockfile.py
blob3aaeac09166b9d6da5eec7c6aaa90eedfa26807d
1 import struct, fcntl
3 def writelock(f):
4 _lock(f, fcntl.F_WRLCK)
6 def readlock(f):
7 _lock(f, fcntl.F_RDLCK)
9 def unlock(f):
10 _lock(f, fcntl.F_UNLCK)
12 def _lock(f, op):
13 dummy = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW,
14 struct.pack('2h8l', op,
15 0, 0, 0, 0, 0, 0, 0, 0, 0))