From 018ab045e3b9c20e35b5dc658fe35f3327048bbf Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 19 Aug 2013 10:38:27 +0000 Subject: Added check for whether thread lock is being removed while thread is using guarded alloc. -- svn merge -r58788:58789 ^/branches/soc-2013-depsgraph_mt --- intern/guardedalloc/intern/mallocn.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'intern') diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 06ae2ee864d..520df788055 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -280,6 +280,12 @@ static void mem_lock_thread(void) static void mem_unlock_thread(void) { +#ifdef DEBUG_THREADS + if (!pthread_equal(pthread_self(), mainid) && thread_lock_callback == NULL) { + assert(!"Thread lock was removed while allocation from thread is in progress"); + } +#endif + if (thread_unlock_callback) thread_unlock_callback(); } -- cgit v1.2.3