[Bf-blender-cvs] [338ebea53e3] master: Cleanup: remove unused global locks from BLI_threads

Campbell Barton noreply at git.blender.org
Fri Sep 18 07:37:11 CEST 2020


Commit: 338ebea53e380d0bfcc49be580c19cc6024d5122
Author: Campbell Barton
Date:   Fri Sep 18 15:30:46 2020 +1000
Branches: master
https://developer.blender.org/rB338ebea53e380d0bfcc49be580c19cc6024d5122

Cleanup: remove unused global locks from BLI_threads

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

M	source/blender/blenlib/BLI_threads.h
M	source/blender/blenlib/intern/threads.cc

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

diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h
index a281aaa5b51..d19b5393aa7 100644
--- a/source/blender/blenlib/BLI_threads.h
+++ b/source/blender/blenlib/BLI_threads.h
@@ -59,21 +59,22 @@ int BLI_system_thread_count(void); /* gets the number of threads the system can
 void BLI_system_num_threads_override_set(int num);
 int BLI_system_num_threads_override_get(void);
 
-/* Global Mutex Locks
+/**
+ * Global Mutex Locks
  *
- * One custom lock available now. can be extended. */
-
-#define LOCK_IMAGE 0
-#define LOCK_DRAW_IMAGE 1
-#define LOCK_VIEWER 2
-#define LOCK_CUSTOM1 3
-#define LOCK_RCACHE 4
-#define LOCK_OPENGL 5
-#define LOCK_NODES 6
-#define LOCK_MOVIECLIP 7
-#define LOCK_COLORMANAGE 8
-#define LOCK_FFTW 9
-#define LOCK_VIEW3D 10
+ * One custom lock available now. can be extended.
+ */
+enum {
+  LOCK_IMAGE = 0,
+  LOCK_DRAW_IMAGE,
+  LOCK_VIEWER,
+  LOCK_CUSTOM1,
+  LOCK_NODES,
+  LOCK_MOVIECLIP,
+  LOCK_COLORMANAGE,
+  LOCK_FFTW,
+  LOCK_VIEW3D,
+};
 
 void BLI_thread_lock(int type);
 void BLI_thread_unlock(int type);
diff --git a/source/blender/blenlib/intern/threads.cc b/source/blender/blenlib/intern/threads.cc
index c206aa8d91f..a2b1a12c783 100644
--- a/source/blender/blenlib/intern/threads.cc
+++ b/source/blender/blenlib/intern/threads.cc
@@ -119,8 +119,6 @@ static pthread_mutex_t _image_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _image_draw_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _nodes_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _movieclip_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _colormanage_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -368,10 +366,6 @@ static ThreadMutex *global_mutex_from_type(const int type)
       return &_viewer_lock;
     case LOCK_CUSTOM1:
       return &_custom1_lock;
-    case LOCK_RCACHE:
-      return &_rcache_lock;
-    case LOCK_OPENGL:
-      return &_opengl_lock;
     case LOCK_NODES:
       return &_nodes_lock;
     case LOCK_MOVIECLIP:



More information about the Bf-blender-cvs mailing list