[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58789] branches/soc-2013-depsgraph_mt/ intern/guardedalloc/intern/mallocn.c: Added check for whether thread lock is being removed while thread is using guarded alloc .

Sergey Sharybin sergey.vfx at gmail.com
Wed Jul 31 23:55:41 CEST 2013


Revision: 58789
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58789
Author:   nazgul
Date:     2013-07-31 21:55:41 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
Added check for whether thread lock is being removed while thread is using guarded alloc.

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/intern/guardedalloc/intern/mallocn.c

Modified: branches/soc-2013-depsgraph_mt/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/guardedalloc/intern/mallocn.c	2013-07-31 21:55:36 UTC (rev 58788)
+++ branches/soc-2013-depsgraph_mt/intern/guardedalloc/intern/mallocn.c	2013-07-31 21:55:41 UTC (rev 58789)
@@ -280,6 +280,12 @@
 
 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();
 }




More information about the Bf-blender-cvs mailing list