Implement newthread() and atpanic()