コード例 #1
0
    def unlink(self):
        """Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block."""
        if _USE_POSIX and self.name:
            _posixshmem.shm_unlink(self.name)
コード例 #2
0
ファイル: shared_memory.py プロジェクト: Eyepea/cpython
    def unlink(self):
        """Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block."""
        if _USE_POSIX and self._name:
            _posixshmem.shm_unlink(self._name)
コード例 #3
0
    def destroy(self) -> None:
        if _USE_POSIX:
            # We manually unlink to bypass all the "resource tracker"
            # nonsense meant for non-SC systems.
            shm_unlink(self._shm.name)

        self._first.destroy()
        self._last.destroy()
コード例 #4
0
 def unlink(self):
     """
     Requests destruction of this memory block.
     Unlink should be called once and only once across all processes
     """
     try:
         _posixshmem.shm_unlink(self._name)
     except FileNotFoundError:
         LOGGER.debug(f"{self.name} tried to unlink twice")
         warnings.warn("Cannot unlink a shared block twice", RuntimeWarning)
コード例 #5
0
    def unlink(self):
        """Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block."""
        if _USE_POSIX and self._name:
            from .resource_tracker import unregister
            _posixshmem.shm_unlink(self._name)
            unregister(self._name, "shared_memory")
コード例 #6
0
    def unlink(self) -> None:
        """Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block."""
        if self._name:
            if not iswindows:
                try:
                    _posixshmem.shm_unlink(self._name)
                except FileNotFoundError:
                    pass
            self._name = ''
コード例 #7
0
 def destroy(self) -> None:
     if shared_memory._USE_POSIX:
         # We manually unlink to bypass all the "resource tracker"
         # nonsense meant for non-SC systems.
         shm_unlink(self._shm.name)