[Bf-blender-cvs] [3b08ee8] master: Follow up to the previous commit: vfont_get_data is to use the same RW lock

Sergey Sharybin noreply at git.blender.org
Sun Dec 29 12:08:05 CET 2013


Commit: 3b08ee89965230063a95c74d656d88178622b996
Author: Sergey Sharybin
Date:   Sun Dec 29 17:07:38 2013 +0600
https://developer.blender.org/rB3b08ee89965230063a95c74d656d88178622b996

Follow up to the previous commit: vfont_get_data is to use the same RW lock

===================================================================

M	source/blender/blenkernel/intern/font.c

===================================================================

diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 6256c87..16ffd0e 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -64,7 +64,6 @@
 #include "BKE_curve.h"
 #include "BKE_displist.h"
 
-static ThreadMutex vfont_mutex = BLI_MUTEX_INITIALIZER;
 static ThreadRWMutex vfont_rwlock = BLI_RWLOCK_INITIALIZER;
 
 /* The vfont code */
@@ -150,7 +149,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
 	if (!vfont->data) {
 		PackedFile *pf;
 
-		BLI_mutex_lock(&vfont_mutex);
+		BLI_rw_mutex_lock(&vfont_rwlock, THREAD_LOCK_WRITE);
 
 		if (vfont->data) {
 			/* Check data again, since it might have been already
@@ -158,7 +157,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
 			 * not accurate or threading, just prevents unneeded
 			 * lock if all the data is here for sure).
 			 */
-			BLI_mutex_unlock(&vfont_mutex);
+			BLI_rw_mutex_unlock(&vfont_rwlock);
 			return vfont->data;
 		}
 
@@ -200,7 +199,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
 			}
 		}
 
-		BLI_mutex_unlock(&vfont_mutex);
+		BLI_rw_mutex_unlock(&vfont_rwlock);
 	}
 
 	return vfont->data;




More information about the Bf-blender-cvs mailing list