summaryrefslogtreecommitdiffstats
path: root/libdimension/raytrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r--libdimension/raytrace.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 6721a9b..3fa873c 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -19,7 +19,6 @@
*************************************************************************/
#include "dimension_impl.h"
-#include <unistd.h> /* For sysconf */
/*
* Boilerplate for multithreading
@@ -109,20 +108,16 @@ static void *dmnsn_raytrace_scene_multithread_thread(void *ptr);
static int
dmnsn_raytrace_scene_multithread(dmnsn_raytrace_payload *payload)
{
- int i, j, nthreads = payload->scene->nthreads;
+ int i, j;
void *ptr;
int retval = 0;
dmnsn_raytrace_payload *payloads;
pthread_t *threads;
- if (!nthreads) {
- /* Find the number of processors/cores running (TODO: do this portably) */
- nthreads = sysconf(_SC_NPROCESSORS_ONLN);
- if (nthreads < 1) {
- nthreads = 1;
- }
- /* End non-portable section */
- }
+ unsigned int nthreads = payload->scene->nthreads;
+ /* Sanity check */
+ if (nthreads < 1)
+ nthreads = 1;
payloads = malloc(nthreads*sizeof(dmnsn_raytrace_payload));
if (!payloads) {