Made2 function POSIX compitable: thread_exit and thread_join