begin thread.c/thread_spirit merge