#include #include void some_message(void) { printf("Hello this is a thread\n"); } void *some_other_thread_code(void *argument) { printf("Hello this is some other thread\n"); return NULL; } // Create a new thread from this thread void *run_thread(void *argument) { pthread_t thread_id; pthread_create(&thread_id, NULL, some_other_thread_code, NULL); pthread_join(thread_id, NULL); some_message(); return NULL; } int main(void) { pthread_t thread_id1; pthread_create(&thread_id1, NULL, run_thread, NULL); pthread_join(thread_id1, NULL); printf("Goodbye\n"); return 0; }