CPU thread creation fix

-fixed thread creation for CPU simulator
-TO-DO: fix cast int->pointer warning