diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:38:27 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:38:27 +0400 |
commit | 018ab045e3b9c20e35b5dc658fe35f3327048bbf (patch) | |
tree | e86354ccce7658b6c5041c26f15f2e1b75e23218 /intern/guardedalloc | |
parent | 9f7961b6b10203733ddda62dac3170d6817ff69b (diff) |
Added check for whether thread lock is being removed while thread is using guarded alloc.
--
svn merge -r58788:58789 ^/branches/soc-2013-depsgraph_mt
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 6 |
1 files changed, 6 insertions, 0 deletions
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(); } |