From 3b08ee89965230063a95c74d656d88178622b996 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 29 Dec 2013 17:07:38 +0600 Subject: Follow up to the previous commit: vfont_get_data is to use the same RW lock --- source/blender/blenkernel/intern/font.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/font.c') diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 6256c878d8d..16ffd0eea3a 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; -- cgit v1.2.3