Requests that the underlying shared memory block be destroyed. Unlink should be called once (and only once) across all handles which have access to the shared memory block, even if these handles belong to different processes. Closing and unlinking may happen in any o
(self)
| 236 | self._fd = -1 |
| 237 | |
| 238 | def unlink(self): |
| 239 | """Requests that the underlying shared memory block be destroyed. |
| 240 | |
| 241 | Unlink should be called once (and only once) across all handles |
| 242 | which have access to the shared memory block, even if these |
| 243 | handles belong to different processes. Closing and unlinking may |
| 244 | happen in any order, but trying to access data inside a shared |
| 245 | memory block after unlinking may result in memory errors, |
| 246 | depending on platform. |
| 247 | |
| 248 | This method has no effect on Windows, where the only way to |
| 249 | delete a shared memory block is to close all handles.""" |
| 250 | |
| 251 | if _USE_POSIX and self._name: |
| 252 | _posixshmem.shm_unlink(self._name) |
| 253 | if self._track: |
| 254 | resource_tracker.unregister(self._name, "shared_memory") |
| 255 | |
| 256 | |
| 257 | _encoding = "utf8" |