aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/calibrate_detector.c2
-rw-r--r--src/cubeit.c1
-rw-r--r--src/facetron.c1
-rw-r--r--src/thread-pool.c2
4 files changed, 2 insertions, 4 deletions
diff --git a/src/calibrate_detector.c b/src/calibrate_detector.c
index 2c68f645..1f413b44 100644
--- a/src/calibrate_detector.c
+++ b/src/calibrate_detector.c
@@ -21,7 +21,6 @@
#include <unistd.h>
#include <getopt.h>
#include <pthread.h>
-#include <sys/time.h>
#include "utils.h"
#include "hdf5-file.h"
@@ -31,7 +30,6 @@
#define INTEGRATION_RADIUS (10)
-#define MAX_THREADS (96)
typedef enum
diff --git a/src/cubeit.c b/src/cubeit.c
index ef892340..09a29540 100644
--- a/src/cubeit.c
+++ b/src/cubeit.c
@@ -389,7 +389,6 @@ static void write_slice(const char *filename, double *vals, int z,
cairo_surface_write_to_png(surface, filename);
cairo_surface_destroy(surface);
-
}
diff --git a/src/facetron.c b/src/facetron.c
index 27fc1608..5693a00c 100644
--- a/src/facetron.c
+++ b/src/facetron.c
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
+#include <pthread.h>
#include "utils.h"
#include "hdf5-file.h"
diff --git a/src/thread-pool.c b/src/thread-pool.c
index 358fb4f3..7781f883 100644
--- a/src/thread-pool.c
+++ b/src/thread-pool.c
@@ -162,7 +162,7 @@ static void *task_worker(void *pargsv)
/* Get a task */
pthread_mutex_lock(&q->lock);
- if ( q->n_started >= q->max ) {
+ if ( (q->max) && (q->n_started >= q->max) ) {
pthread_mutex_unlock(&q->lock);
break;
}