diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2015-05-19 16:39:34 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-05-25 16:43:20 +1000 |
commit | 1c8aa34e3047f315a89d407a637c992e035d05ff (patch) | |
tree | b89c69d6590897d1a751ba5ff7213b0929fba51d | |
parent | 8411609f3bc3c1dee36c8690e8d09d269d03894d (diff) | |
download | mongo-1c8aa34e3047f315a89d407a637c992e035d05ff.tar.gz |
Merge pull request #1979 from wiredtiger/log-slot-volatile
Fix a hang in __wt_log_slot_join
(cherry picked from commit 3ac4aeef2629a2c185ea56accfe8235f53c0c623)
-rw-r--r-- | src/include/log.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/log.h b/src/include/log.h index ebe3a00b19f..e522a619c9a 100644 --- a/src/include/log.h +++ b/src/include/log.h @@ -68,6 +68,9 @@ * WT_LOG_SLOT_WRITTEN - slot is written and should be processed by worker. * WT_LOG_SLOT_READY - slot is ready for threads to join. * > WT_LOG_SLOT_READY - threads are actively consolidating on this slot. + * + * The slot state must be volatile: threads loop checking the state and can't + * cache the first value they see. */ #define WT_LOG_SLOT_DONE 0 #define WT_LOG_SLOT_FREE 1 @@ -75,7 +78,7 @@ #define WT_LOG_SLOT_WRITTEN 3 #define WT_LOG_SLOT_READY 4 typedef WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) struct { - int64_t slot_state; /* Slot state */ + volatile int64_t slot_state; /* Slot state */ uint64_t slot_group_size; /* Group size */ int32_t slot_error; /* Error value */ #define SLOT_INVALID_INDEX 0xffffffff |