MCPcopy Create free account
hub / github.com/ActiveState/code / release

Method release

recipes/Python/577524_Python_Sessions/recipe-577524.py:261–269  ·  view source on GitHub ↗

Get rid of the lock by deleting the lockfile. When working in a `with` statement, this gets automatically called at the end.

(self)

Source from the content-addressed store, hash-verified

259 self.is_locked = True
260
261 def release(self):
262 """ Get rid of the lock by deleting the lockfile.
263 When working in a `with` statement, this gets automatically
264 called at the end.
265 """
266 if self.is_locked:
267 os.close(self.fd)
268 os.unlink(self.lockfile)
269 self.is_locked = False
270
271 def __enter__(self):
272 """ Activated when used in the with statement.

Callers 15

__exit__Method · 0.95
__del__Method · 0.95
setThreadCountMethod · 0.45
getThreadCountMethod · 0.45
queueTaskMethod · 0.45
getNextTaskMethod · 0.45
joinAllMethod · 0.45
mainFunction · 0.45
__serveMethod · 0.45
__getattribute__Method · 0.45
__setattr__Method · 0.45
__delattr__Method · 0.45

Calls 2

unlinkMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected