no-thread option, coalesced tunnel lut, more accurate fps counter
[fbgfx] / src / tpool.c
index 4c1309b..4d06570 100644 (file)
@@ -1,3 +1,4 @@
+#ifndef NO_THREADS
 /* worker thread pool based on POSIX threads
  * author: John Tsiombikas <nuclear@member.fsf.org>
  * This code is public domain.
@@ -200,9 +201,11 @@ long tpool_timedwait(struct thread_pool *tpool, long timeout)
 {
        struct timespec tout_ts;
        struct timeval tv0, tv;
+       long sec;
+
        gettimeofday(&tv0, 0);
 
-       long sec = timeout / 1000;
+       sec = timeout / 1000;
        tout_ts.tv_nsec = tv0.tv_usec * 1000 + (timeout % 1000) * 1000000;
        tout_ts.tv_sec = tv0.tv_sec + sec;
 
@@ -309,3 +312,5 @@ int tpool_num_processors(void)
        return info.dwNumberOfProcessors;
 #endif
 }
+
+#endif /* !def NO_THREADS */