From 39e66e4d6f48b7a54a510ec5504fd500cc07174f Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 1 Oct 2008 18:00:13 +0000 Subject: Bug fixing It helps if the fonction to wait on all threads actual does that. Use user parameter for number of threads (this is really looking like it should be in the userprefs and not render params). --- source/blender/blenlib/intern/threads.c | 1 - source/blender/src/autoarmature.c | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 01e862a9693..9df8bbc81e3 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -225,7 +225,6 @@ void BLI_remove_threads(ListBase *threadbase) tslot->callerdata = NULL; pthread_join(tslot->pthread, NULL); tslot->avail = 1; - break; } } } diff --git a/source/blender/src/autoarmature.c b/source/blender/src/autoarmature.c index b68b4cbe785..5e4b52c08a6 100644 --- a/source/blender/src/autoarmature.c +++ b/source/blender/src/autoarmature.c @@ -78,7 +78,6 @@ struct RigNode; struct RigArc; struct RigEdge; -#define NB_THREADS 4 #define USE_THREADS typedef struct RigGraph { @@ -328,6 +327,8 @@ void RIG_freeRigGraph(BGraph *rg) static RigGraph *newRigGraph() { RigGraph *rg; + int totthread; + rg = MEM_callocN(sizeof(RigGraph), "rig graph"); rg->head = NULL; @@ -339,7 +340,16 @@ static RigGraph *newRigGraph() rg->free_node = NULL; #ifdef USE_THREADS - rg->worker = BLI_create_worker(exec_retargetArctoArc, NB_THREADS, 20); /* fix number of threads */ + if(G.scene->r.mode & R_FIXED_THREADS) + { + totthread = G.scene->r.threads; + } + else + { + totthread = BLI_system_thread_count(); + } + + rg->worker = BLI_create_worker(exec_retargetArctoArc, totthread, 20); /* fix number of threads */ #endif return rg; -- cgit v1.2.3