'Runs ``callback`` when this process exits.
The callback takes one argument, the return code of the process.
This method uses a ``SIGCHLD`` handler, which is a global setting
and may conflict if you have other libraries trying to handle the
same signal.  If you are using more than one ``IOLoop`` it may
be necessary to call `Subprocess.initialize` first to designate
one ``IOLoop`` to run the signal handlers.
In many cases a close callback on the stdout or stderr streams
can be used as an alternative to an exit callback if the
signal handler is causing a problem.'

def set_exit_callback(self, callback):

    self._exit_callback = stack_context.wrap(callback)
    Subprocess.initialize()
    Subprocess._waiting[self.pid] = self
    Subprocess._try_cleanup_process(self.pid)
