diff options
-rw-r--r-- | source/blender/blenlib/BLI_task.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h index d27bf4dad20..a551124375e 100644 --- a/source/blender/blenlib/BLI_task.h +++ b/source/blender/blenlib/BLI_task.h @@ -97,7 +97,7 @@ void BLI_task_pool_work_and_wait(TaskPool *pool); void BLI_task_pool_cancel(TaskPool *pool); /* set number of threads allowed to be used by this pool */ -void BLI_pool_set_num_threads(TaskPool *pool, int num_threads); +void BLI_pool_set_num_threads(TaskPool *pool, size_t num_threads); /* for worker threads, test if canceled */ bool BLI_task_pool_canceled(TaskPool *pool); diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c index e53327640fb..f3ad071b884 100644 --- a/source/blender/blenlib/intern/task.c +++ b/source/blender/blenlib/intern/task.c @@ -49,7 +49,7 @@ #define MEMPOOL_SIZE 256 /* Parameters controlling how much we spin in nanosleeps before switching to real condition-controlled sleeping. */ -#define NANOSLEEP_MAX_SPINNING 1000 /* Number of failed attempt to get a task before going to condition waiting. */ +#define NANOSLEEP_MAX_SPINNING 200 /* Number of failed attempt to get a task before going to condition waiting. */ #define NANOSLEEP_DURATION (const struct timespec[]){{0, 200L}} /* Nanosleep duration (in nano-seconds). */ typedef struct Task { @@ -743,7 +743,7 @@ void BLI_task_pool_work_and_wait(TaskPool *pool) } } -void BLI_pool_set_num_threads(TaskPool *pool, size_t num_threads_max) +void BLI_pool_set_num_threads(TaskPool *pool, size_t num_threads) { /* NOTE: Don't try to modify threads while tasks are running! */ pool->num_threads = num_threads; |