slightly more efficient implementation of Graph::in_process_thread()