Change the thread api a bit.