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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-07 23:07:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-07 23:24:05 +0400
commitb3afbcab8ff2330c1473647be330a3ffe9b11885 (patch)
treee86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/blenlib/intern/threads.c
parent1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff)
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r--source/blender/blenlib/intern/threads.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 0b8f5dfdde5..5d8c1af6c7f 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -184,7 +184,7 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
int a;
if (threadbase != NULL && tot > 0) {
- threadbase->first = threadbase->last = NULL;
+ BLI_listbase_clear(threadbase);
if (tot > RE_MAX_THREAD) tot = RE_MAX_THREAD;
else if (tot < 1) tot = 1;
@@ -318,7 +318,7 @@ void BLI_end_threads(ListBase *threadbase)
/* only needed if there's actually some stuff to end
* this way we don't end up decrementing thread_levels on an empty threadbase
* */
- if (threadbase && threadbase->first != NULL) {
+ if (threadbase && (BLI_listbase_is_empty(threadbase) == false)) {
for (tslot = threadbase->first; tslot; tslot = tslot->next) {
if (tslot->avail == 0) {
pthread_join(tslot->pthread, NULL);