It is possible to create new threads, wait for other threads to finish or finish currently running thread.
Threads are defined by their entry function, which treated similarly to main() function of a C program. If thread entry function returns, then it’s return value is used as thread return status. This is not interpreted by kernel in any way, but it is available for others.
get_tidthread ID of currently running thread.
int os_thread_dispose(int arg0)This function is injected into stack (value of LR of thread entrypoint) of each thread, so if thread entry function returns, the thread is disposed automatically. It causes thread to exit with value returned by thread entrypoint to be recorded as thread return value.
arg0 value returned by thread entrypoint