I’m attempting to run an event loop from within a pthread but I’ve run into a problem I can’t seem to google-fix. Basically, it looks like this:
event_thread = pthread_create(&event_thread, NULL,
(void *) g_main_loop_run, (void *) event_loop);
printf("GOT HERE\n");
The message below pthread_create never prints, is there a way to “fire and forget” a thread?
Well, figured that one out as soon as I posted this, here’s what I ended up doing:
You just need to set the threads state to “detached”.