summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/rwsem.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/rwsem.h')
-rw-r--r--tools/perf/util/rwsem.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/rwsem.h b/tools/perf/util/rwsem.h
index 94565ad4d4..ef5cbc31d9 100644
--- a/tools/perf/util/rwsem.h
+++ b/tools/perf/util/rwsem.h
@@ -2,9 +2,20 @@
#define _PERF_RWSEM_H
#include <pthread.h>
+#include "mutex.h"
+
+/*
+ * Mutexes have additional error checking. Enable to use a mutex rather than a
+ * rwlock for debugging.
+ */
+#define RWS_ERRORCHECK 0
struct rw_semaphore {
+#if RWS_ERRORCHECK
+ struct mutex mtx;
+#else
pthread_rwlock_t lock;
+#endif
};
int init_rwsem(struct rw_semaphore *sem);