Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2008-09-26 00:29:15 +0400
committerMartin Poirier <theeth@yahoo.com>2008-09-26 00:29:15 +0400
commitec9295db3a1f02bea0396d03ba7b6d5b9969914d (patch)
treeb9bb8df93f2e25d0fdaf78c01af2bfd04cf9dc2c /source/blender/blenlib
parent6a8e7236cb58096db9430ec6f9ae1235d71e85c7 (diff)
Keep persistent results for retargeting. Easier weight adjustement.
Will have to do a second pass tomorrow to fix some leftovers.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_threads.h1
-rw-r--r--source/blender/blenlib/intern/threads.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h
index 92bcd6798a0..5a7e84c42fb 100644
--- a/source/blender/blenlib/BLI_threads.h
+++ b/source/blender/blenlib/BLI_threads.h
@@ -45,6 +45,7 @@ int BLI_available_thread_index(struct ListBase *threadbase);
void BLI_insert_thread (struct ListBase *threadbase, void *callerdata);
void BLI_remove_thread (struct ListBase *threadbase, void *callerdata);
void BLI_remove_thread_index(struct ListBase *threadbase, int index);
+void BLI_remove_threads(struct ListBase *threadbase);
void BLI_end_threads (struct ListBase *threadbase);
void BLI_lock_thread (int type);
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 296ed13d35e..01e862a9693 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -216,6 +216,20 @@ void BLI_remove_thread_index(ListBase *threadbase, int index)
}
}
+void BLI_remove_threads(ListBase *threadbase)
+{
+ ThreadSlot *tslot;
+
+ for(tslot = threadbase->first; tslot; tslot = tslot->next) {
+ if (tslot->avail == 0) {
+ tslot->callerdata = NULL;
+ pthread_join(tslot->pthread, NULL);
+ tslot->avail = 1;
+ break;
+ }
+ }
+}
+
void BLI_end_threads(ListBase *threadbase)
{
ThreadSlot *tslot;
@@ -336,7 +350,7 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep
void BLI_end_worker(ThreadedWorker *worker)
{
- BLI_end_threads(&worker->threadbase);
+ BLI_remove_threads(&worker->threadbase);
}
void BLI_destroy_worker(ThreadedWorker *worker)