We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23ba840 commit f682862Copy full SHA for f682862
src/flusher.cc
@@ -157,7 +157,7 @@ void Flusher::wake(void) {
157
158
bool Flusher::step(GlobalTask *task) {
159
try {
160
- switch (_state) {
+ switch (_state.load()) {
161
case initializing:
162
initialize(task->getId());
163
return true;
src/flusher.h
@@ -105,7 +105,10 @@ class Flusher {
105
}
106
107
EventuallyPersistentStore *store;
108
- volatile enum flusher_state _state;
+ AtomicValue<enum flusher_state> _state;
109
+
110
+ // Used for serializaling attempts to start the flusher from
111
+ // different threads.
112
Mutex taskMutex;
113
size_t taskId;
114
0 commit comments