guard_thread
error = pthread_create(&td, NULL, guard_thread, res);
static void *guard_thread(void *arg);