From b3afbcab8ff2330c1473647be330a3ffe9b11885 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Feb 2014 06:07:10 +1100 Subject: ListBase API: add utility api funcs for clearing and checking empty --- source/blender/blenlib/intern/threads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/intern/threads.c') 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); -- cgit v1.2.3