我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用msvcrt.LK_UNLCK。
def unlock(self): msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1)
def _unlock(lockfile): fileno = lockfile.fileno() msvcrt.locking(fileno, msvcrt.LK_UNLCK, 1)
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
def _unlock_file(self): try: self.fp.seek(0) msvcrt.locking(self.fp.fileno(), msvcrt.LK_UNLCK, 1) except IOError: raise UnlockError(self.fp.name)