[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20703] branches/blender2.5/blender/source /blender: 2.5

Ton Roosendaal ton at blender.org
Sun Jun 7 14:12:56 CEST 2009


Revision: 20703
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20703
Author:   ton
Date:     2009-06-07 14:12:55 +0200 (Sun, 07 Jun 2009)

Log Message:
-----------
2.5

Quick test commit to check on crashing previews; ignore warning about
implicit declaration...  here in OSX i can't get this crash!

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenlib/intern/threads.c
    branches/blender2.5/blender/source/blender/editors/preview/previewrender.c

Modified: branches/blender2.5/blender/source/blender/blenlib/intern/threads.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/intern/threads.c	2009-06-07 11:42:13 UTC (rev 20702)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/threads.c	2009-06-07 12:12:55 UTC (rev 20703)
@@ -112,12 +112,12 @@
 	int avail;
 } ThreadSlot;
 
-static void BLI_lock_malloc_thread(void)
+void BLI_lock_malloc_thread(void)
 {
 	pthread_mutex_lock(&_malloc_lock);
 }
 
-static void BLI_unlock_malloc_thread(void)
+void BLI_unlock_malloc_thread(void)
 {
 	pthread_mutex_unlock(&_malloc_lock);
 }

Modified: branches/blender2.5/blender/source/blender/editors/preview/previewrender.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/preview/previewrender.c	2009-06-07 11:42:13 UTC (rev 20702)
+++ branches/blender2.5/blender/source/blender/editors/preview/previewrender.c	2009-06-07 12:12:55 UTC (rev 20703)
@@ -44,6 +44,7 @@
 
 #include "BLI_arithb.h"
 #include "BLI_blenlib.h"
+#include "BLI_threads.h"
 
 #include "DNA_texture_types.h"
 #include "DNA_world_types.h"
@@ -634,6 +635,7 @@
 	char name[32];
 	
 	sprintf(name, "Preview %p", sa);
+	BLI_lock_malloc_thread();
 	RE_GetResultImage(RE_GetRender(name), &rres);
 
 	if(rres.rectf) {
@@ -648,7 +650,8 @@
 			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 		}
 	}
-	
+	BLI_unlock_malloc_thread();
+
 	/* check for spacetype... */
 	if(sbuts->spacetype==SPACE_BUTS && sbuts->preview) {
 		sbuts->preview= 0;





More information about the Bf-blender-cvs mailing list