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:
authorHans Goudey <h.goudey@me.com>2022-10-13 06:31:02 +0300
committerHans Goudey <h.goudey@me.com>2022-10-13 06:31:50 +0300
commitc67e5628d22f8348492b6205081fe1798d50689c (patch)
tree01b7b5e46f080f0359c06b389d7d1a544279e325 /source/blender/blenkernel/BKE_mesh_types.h
parent375dafe3ef40eb61e831902a1ae45ecca555fec6 (diff)
Cleanup: Use std::mutex for mesh runtime mutexes
Instead of allocating three separate ThreadMutex pointers, just embed std::mutex into the struct directly.
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh_types.h')
-rw-r--r--source/blender/blenkernel/BKE_mesh_types.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_mesh_types.h b/source/blender/blenkernel/BKE_mesh_types.h
index 8f3fee70c7f..dacc2188abb 100644
--- a/source/blender/blenkernel/BKE_mesh_types.h
+++ b/source/blender/blenkernel/BKE_mesh_types.h
@@ -9,6 +9,8 @@
#ifdef __cplusplus
+# include <mutex>
+
# include "BLI_span.hh"
# include "DNA_customdata_types.h"
@@ -73,14 +75,14 @@ struct MeshRuntime {
* This mesh is used as a result of modifier stack evaluation.
* Since modifier stack evaluation is threaded on object level we need some synchronization. */
Mesh *mesh_eval = nullptr;
- void *eval_mutex = nullptr;
+ std::mutex eval_mutex;
/* A separate mutex is needed for normal calculation, because sometimes
* the normals are needed while #eval_mutex is already locked. */
- void *normals_mutex = nullptr;
+ std::mutex normals_mutex;
/** Needed to ensure some thread-safety during render data pre-processing. */
- void *render_mutex = nullptr;
+ std::mutex render_mutex;
/** Lazily initialized SoA data from the #edit_mesh field in #Mesh. */
EditMeshData *edit_data = nullptr;
@@ -148,9 +150,9 @@ struct MeshRuntime {
*/
uint32_t *subsurf_face_dot_tags = nullptr;
- MeshRuntime();
+ MeshRuntime() = default;
/** \warning This does not free all data currently. See #BKE_mesh_runtime_free_data. */
- ~MeshRuntime();
+ ~MeshRuntime() = default;
MEM_CXX_CLASS_ALLOC_FUNCS("MeshRuntime")
};