Merging r59136 through r59152 from trunk into soc-2013-depsgraph_mt
[blender.git] / intern / guardedalloc / intern / mallocn.c
index 06ae2ee864d5470ed0abb008a239ed916fc8a4ff..520df7880554df5eab1d85115800ee897345c9f3 100644 (file)
@@ -280,6 +280,12 @@ static void mem_lock_thread(void)
 
 static void mem_unlock_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();
 }
        if (thread_unlock_callback)
                thread_unlock_callback();
 }