Listing 2: Waiting for a Thread to Exit // Create and run a thread thr_create(NULL, 0, runThread, myData, 0, &tid); ... // Wait for the thread to finish before continuing thr_join(tid, NULL, NULL);