def release(self):
if os.name == 'nt':
msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1)
else:
fcntl.lockf(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
if self.lockfile is not None:
self.lockfile.close()
self.lockfile = None
评论列表
文章目录