'Make sure that semaphore tracker process is running.
This can be run from any process.  Usually a child process will use
the semaphore created by its parent.'

def ensure_running(self):

    with self._lock:
        if (self._fd is not None):
            return
        fds_to_pass = []
        try:
            fds_to_pass.append(sys.stderr.fileno())
        except Exception:
            pass
        cmd = 'from    multiprocessing.semaphore_tracker    import    main;main(%d)'
        (r, w) = os.pipe()
        try:
            fds_to_pass.append(r)
            exe = spawn.get_executable()
            args = ([exe] + util._args_from_interpreter_flags())
            args += ['-c', (cmd % r)]
            util.spawnv_passfds(exe, args, fds_to_pass)
        except:
            os.close(w)
            raise
        else:
            self._fd = w
        finally:
            os.close(r)
