perror("malloc() failed");
return NULL;
}
+ #ifdef HAVE_THREADS
if(!pthread_mutex_initialized) {
THREAD_MUTEX_INIT(synchronized);
pthread_mutex_initialized = 1;
}
+ #endif
gettimeofday(&timeout, NULL);
SYNCHRONIZE(synchronized);
timeout.tv_usec += (useconds % 1000);
}
int timeq_del(struct timeq_entry* entry) {
+ #ifdef HAVE_THREADS
if(!pthread_mutex_initialized) return 0;
+ #endif
SYNCHRONIZE(synchronized);
if(entry->next)
entry->next->prev = entry->prev;