Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-11 16:32:56 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-11 16:38:58 +0300
commit498ffef7b054c08a1d05271aeb4fde5eeeebf450 (patch)
treedff47701634d58af3adc94ffea2e3a1d474e67d7 /source/blender/blenkernel/intern/subsurf_ccg.c
parentb415ed55a74c51b944cd0682fc7a81679778ac8f (diff)
Subsurf: Use regular mutex instead of RW one
Mutex is now local to particular CCGDM, and guarding edge hash which is only used by a single function only. There is no need to acquire read lock after edge hash was created.
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index d2f325fb3c4..c6b701d2d28 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1488,7 +1488,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
/* DMFlagMat *faceFlags = ccgdm->faceFlags; */ /* UNUSED */
if (!ccgdm->ehash) {
- BLI_rw_mutex_lock(&ccgdm->loops_cache_rwlock, THREAD_LOCK_WRITE);
+ BLI_mutex_lock(&ccgdm->loops_cache_lock);
if (!ccgdm->ehash) {
MEdge *medge;
EdgeHash *ehash;
@@ -1502,10 +1502,9 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
atomic_cas_ptr((void**)&ccgdm->ehash, ccgdm->ehash, ehash);
}
- BLI_rw_mutex_unlock(&ccgdm->loops_cache_rwlock);
+ BLI_mutex_unlock(&ccgdm->loops_cache_lock);
}
- BLI_rw_mutex_lock(&ccgdm->loops_cache_rwlock, THREAD_LOCK_READ);
totface = ccgSubSurf_getNumFaces(ss);
ml = mloop;
for (index = 0; index < totface; index++) {
@@ -1548,7 +1547,6 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
}
}
}
- BLI_rw_mutex_unlock(&ccgdm->loops_cache_rwlock);
}
static void ccgDM_copyFinalPolyArray(DerivedMesh *dm, MPoly *mpoly)
@@ -4050,7 +4048,7 @@ static void ccgDM_release(DerivedMesh *dm)
MEM_freeN(ccgdm->faceMap);
}
- BLI_rw_mutex_end(&ccgdm->loops_cache_rwlock);
+ BLI_mutex_end(&ccgdm->loops_cache_lock);
BLI_rw_mutex_end(&ccgdm->origindex_cache_rwlock);
MEM_freeN(ccgdm);
@@ -5044,7 +5042,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.numLoopData = ccgdm->dm.numPolyData * 4;
ccgdm->dm.numTessFaceData = 0;
- BLI_rw_mutex_init(&ccgdm->loops_cache_rwlock);
+ BLI_mutex_init(&ccgdm->loops_cache_lock);
BLI_rw_mutex_init(&ccgdm->origindex_cache_rwlock);
return ccgdm;