]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/lockmgr.h
Tweak mutex order for SD
[bacula/bacula] / bacula / src / lib / lockmgr.h
index d84bcd7ee02b45fd92b3c51be4705f1e7af98868..03210a9880001b8e242988efa362fa4e53d44ac8 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _LOCKMGR_H
 #define _LOCKMGR_H 1
 
+#include "mutex_list.h"     /* Manage mutex with priority in a central place */
+
 /*
  * P and V op that don't use the lock manager (for memory allocation or on
  * win32)
@@ -155,9 +157,10 @@ int lmgr_thread_create(pthread_t *thread,
 
 /* Define USE_LOCKMGR_PRIORITY to detect mutex wrong order */
 #ifdef USE_LOCKMGR_PRIORITY
-# define BTHREAD_MUTEX_PRIORITY(p)      {PTHREAD_MUTEX_INITIALIZER, p}
+# define BTHREAD_MUTEX_PRIORITY(p)       {PTHREAD_MUTEX_INITIALIZER, p}
 #else
-# define BTHREAD_MUTEX_PRIORITY(p)      BTHREAD_MUTEX_NO_PRIORITY
+# define BTHREAD_MUTEX_PRIORITY(p)       BTHREAD_MUTEX_NO_PRIORITY
+# define bthread_mutex_set_priority(x,y)
 #endif
 
 #define bthread_mutex_lock(x)      bthread_mutex_lock_p(x, __FILE__, __LINE__)
@@ -188,9 +191,9 @@ int lmgr_thread_create(pthread_t *thread,
 # define lmgr_dump()
 # define lmgr_init_thread()
 # define lmgr_cleanup_thread()
-# define lmgr_pre_lock(m, f, l)
+# define lmgr_pre_lock(m, prio, f, l)
 # define lmgr_post_lock()
-# define lmgr_do_lock(m, f, l)
+# define lmgr_do_lock(m, prio, f, l)
 # define lmgr_do_unlock(m)
 # define lmgr_cleanup_main()
 # define bthread_mutex_set_priority(a)
@@ -203,13 +206,7 @@ int lmgr_thread_create(pthread_t *thread,
 # define V(x) lmgr_v(&(x))
 # define BTHREAD_MUTEX_PRIORITY(p)      PTHREAD_MUTEX_INITIALIZER
 # define BTHREAD_MUTEX_NO_PRIORITY      PTHREAD_MUTEX_INITIALIZER
-# define BTHREAD_MUTEX_PRIORITY_1       PTHREAD_MUTEX_INITIALIZER
-# define BTHREAD_MUTEX_PRIORITY_2       PTHREAD_MUTEX_INITIALIZER
-# define BTHREAD_MUTEX_PRIORITY_3       PTHREAD_MUTEX_INITIALIZER
-# define BTHREAD_MUTEX_PRIORITY_4       PTHREAD_MUTEX_INITIALIZER
 # define BTHREAD_MUTEX_INITIALIZER      PTHREAD_MUTEX_INITIALIZER
 #endif  /* _USE_LOCKMGR */
 
-#include "mutex_list.h"     /* Manage mutex with priority in a central place */
-
 #endif  /* _LOCKMGR_H */