both the parent and the child need to have a call to pthread_join() The error path, after the call to fork() also has the thread running, so it should also have a call to pthread_join() Note: when calling pthread_create() , should always check the returned value to assure the operation was successful