The create_thread primitive creates a new thread, starting the new thread's execution at the function func specified by create_thread()'s first argument, and passing it the argument specified by create_thread()'s second argument. This newly created thread will terminate when it returns from the starting function specified by func. The create_thread() primitive returns the thread_id_t corresponding to the newly created child thread.
This primitive will abort the program if more than NR_THREADS threads are created, counting the one implicitly created by running the program. NR_THREADS is a compile-time constant that may be modified, though some systems may have an upper bound for the allowable number of threads.