diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-10-01 22:00:13 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-10-01 22:00:13 +0400 |
commit | 39e66e4d6f48b7a54a510ec5504fd500cc07174f (patch) | |
tree | 34068ab118acff276bdb19c8164168cb4136752b | |
parent | ff096645adeb0c04ee06a82764336b589217f93a (diff) |
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).
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 1 | ||||
-rw-r--r-- | 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; |