summaryrefslogtreecommitdiff
path: root/src/include/mutex.h
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2013-11-01 15:53:13 -0400
committerKeith Bostic <keith@wiredtiger.com>2013-11-01 15:53:13 -0400
commit1b50234a9f43a8ef2607ee382f4f5c85a047f4b6 (patch)
treea9d20a4f0b64486ca696e8c73a5e3c29d4e8b2c3 /src/include/mutex.h
parent98338b858db03dc741b10353d0285d36e80e95c9 (diff)
downloadmongo-1b50234a9f43a8ef2607ee382f4f5c85a047f4b6.tar.gz
Do a full-barrier when spinlock logging is configured, it cuts down on
the number of races. Add statistics to track the number of spinlock acquisitions.
Diffstat (limited to 'src/include/mutex.h')
-rw-r--r--src/include/mutex.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/mutex.h b/src/include/mutex.h
index 8f0db03de1e..dc556c3deba 100644
--- a/src/include/mutex.h
+++ b/src/include/mutex.h
@@ -54,8 +54,10 @@ typedef volatile int
typedef struct {
pthread_mutex_t lock;
- const char *name; /* Mutex name, for statistics */
- int8_t id; /* Current holder, for statistics */
+ uint64_t counter; /* Statistics: counter */
+
+ const char *name; /* Statistics: mutex name */
+ int8_t id; /* Statistics: current holder ID */
int8_t initialized; /* Lock initialized, for cleanup */
} WT_SPINLOCK WT_GCC_ATTRIBUTE((aligned(WT_CACHE_LINE_ALIGNMENT)));