MCPcopy Index your code
hub / github.com/python/cpython / close

Method close

Lib/multiprocessing/shared_memory.py:225–236  ·  view source on GitHub ↗

Closes access to the shared memory from this instance but does not destroy the shared memory block.

(self)

Source from the content-addressed store, hash-verified

223 return self._size
224
225 def close(self):
226 """Closes access to the shared memory from this instance but does
227 not destroy the shared memory block."""
228 if self._buf is not None:
229 self._buf.release()
230 self._buf = None
231 if self._mmap is not None:
232 self._mmap.close()
233 self._mmap = None
234 if _USE_POSIX and self._fd >= 0:
235 os.close(self._fd)
236 self._fd = -1
237
238 def unlink(self):
239 """Requests that the underlying shared memory block be destroyed.

Calls 1

releaseMethod · 0.45