fixed "unused variable" and some timeq errors when not using threads on compile
[NeonServV5.git] / src / timeq.c
index 7689b316f0fb35d2614c47d1b9ac212d31baa981..b71bb7569f42480450017870cb693b063f49c3e0 100644 (file)
@@ -49,10 +49,12 @@ struct timeq_entry* timeq_uadd(int useconds, int module_id, timeq_callback_t *ca
         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);
@@ -83,7 +85,9 @@ struct timeq_entry* timeq_uadd_name(char *name, int useconds, int module_id, tim
 }
 
 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;