l33t/missions/runner.h

18 lines
351 B
C
Raw Normal View History

2024-11-28 23:16:16 +00:00
#include <pthread.h>
#include "../state.h"
pthread_t mission_thread ;
void run_mission(state_t * state, void * mission(void * data)){
pthread_create(&mission_thread,NULL, mission,(void *) state);
}
void wait_mission(){
if (pthread_join(mission_thread, NULL) != 0) {
perror("pthread_join");
exit(EXIT_FAILURE);
}
}