File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -143,14 +143,13 @@ void Flusher::start() {
143
143
LockHolder lh (taskMutex);
144
144
if (taskId) {
145
145
LOG (EXTENSION_LOG_WARNING, " Double start in flusher task id %llu: %s" ,
146
- taskId, stateName ());
146
+ taskId. load () , stateName ());
147
147
return ;
148
148
}
149
149
schedule_UNLOCKED ();
150
150
}
151
151
152
152
void Flusher::wake (void ) {
153
- LockHolder lh (taskMutex);
154
153
cb_assert (taskId > 0 );
155
154
ExecutorPool::get ()->wake (taskId);
156
155
}
@@ -196,7 +195,6 @@ bool Flusher::step(GlobalTask *task) {
196
195
transition_state (stopped);
197
196
case stopped:
198
197
{
199
- LockHolder lh (taskMutex);
200
198
taskId = 0 ;
201
199
return false ;
202
200
}
Original file line number Diff line number Diff line change @@ -117,8 +117,11 @@ class Flusher {
117
117
118
118
EventuallyPersistentStore *store;
119
119
AtomicValue<enum flusher_state> _state;
120
+
121
+ // Used for serializaling attempts to start the flusher from
122
+ // different threads.
120
123
Mutex taskMutex;
121
- size_t taskId;
124
+ AtomicValue< size_t > taskId;
122
125
123
126
double minSleepTime;
124
127
uint16_t initCommitInterval;
You can’t perform that action at this time.
0 commit comments