def join(self, timeout=None):
      """
      Wait cooperatively until child process terminates or timeout occurs.

      :arg timeout: ``None`` (default) or a a time in seconds. The method
         simply returns upon timeout expiration. The state of the process
         has to be identified via ``is_alive()``.
      """
      assert self._parent_pid == os.getpid(), "I'm not parent of this child."
      assert self._popen is not None, 'Can only join a started process.'
      # Resemble multiprocessing's join() method while replacing
      # `self._popen.wait(timeout)` with
      # `self._returnevent.wait(timeout)`
      self._returnevent.wait(timeout)
      if self._popen.returncode is not None:
         if hasattr(multiprocessing.process, '_children'): # This is for Python 3.4.
            kids = multiprocessing.process._children
         else: # For Python 2.6, 2.7, 3.3.
            kids = multiprocessing.process._current_process._children
         kids.discard(self)