def __release_lock(self):
            """Invoked to release the lock on the pidfile.

            This should only be called when the process terminates.
            @return:
            @rtype:
            """
            if self.__locked_fd is None:
                return

            os.unlink(self.__pidfile)
            try:
                fcntl.flock(self.__locked_fd, fcntl.LOCK_UN)
            except IOError, e:
                self._log('Unexpected error seen releasing lock: %s' % str(e))

            self.__locked_fd.close()
            self.__locked_fd = None
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/platform_posix.py/PidfileManager.PidWriter.__release_lock/original