@@ -76,17 +76,17 @@ ScopedView<Sample> IterationQueue::requestEmptySlot() {
76
76
current_iterator++;
77
77
}
78
78
79
- auto view =
80
- ScopedView<Sample>( &(*current_iterator),
81
- [current_being_filed = this ->being_filled ] {
82
- current_being_filed->markSampleFilled ();
83
- },
84
- [this , current_being_filled = this ->being_filled ] {
85
- std::unique_lock lg (empty_mutex);
86
- this ->markEmpty (current_being_filled);
87
- num_being_filled--;
88
- notify_emptied_cv.notify_all ();
89
- });
79
+ auto view = ScopedView<Sample>(
80
+ &(*current_iterator),
81
+ [current_being_filed = this ->being_filled ] {
82
+ current_being_filed->markSampleFilled ();
83
+ },
84
+ [this , current_being_filled = this ->being_filled ] {
85
+ std::unique_lock lg (empty_mutex);
86
+ this ->markEmpty (current_being_filled);
87
+ num_being_filled--;
88
+ notify_emptied_cv.notify_all ();
89
+ });
90
90
return view;
91
91
}
92
92
@@ -168,23 +168,22 @@ void IterationQueue::markEmpty(MarkableIteration *iteration) {
168
168
IterationQueue::MarkableIteration::MarkableIteration (
169
169
const std::vector<ml::train::TensorDim> &input_dims,
170
170
const std::vector<ml::train::TensorDim> &label_dims, IterationQueue *iq) :
171
- num_observed (0 ),
172
- iteration (input_dims, label_dims),
173
- iq (iq) {}
171
+ num_observed (0 ), iteration(input_dims, label_dims), iq(iq) {}
174
172
175
173
IterationQueue::MarkableIteration::MarkableIteration (MarkableIteration &&rhs) :
176
- num_observed (rhs.num_observed),
177
- iteration (std::move(rhs.iteration)),
178
- iq (rhs.iq) {}
174
+ iteration (std::move(rhs.iteration)), iq(rhs.iq) {
175
+ std::lock_guard notify_lock_guard (notify_mutex);
176
+ num_observed = rhs.num_observed ;
177
+ }
179
178
180
179
void IterationQueue::MarkableIteration::reset () {
181
180
std::lock_guard notify_lock_guard (notify_mutex);
182
181
num_observed = 0 ;
183
182
iteration.setEndSample ();
184
183
}
185
184
186
- IterationQueue::MarkableIteration &IterationQueue::MarkableIteration::
187
- operator =(MarkableIteration &&rhs) {
185
+ IterationQueue::MarkableIteration &
186
+ IterationQueue::MarkableIteration:: operator =(MarkableIteration &&rhs) {
188
187
if (this == &rhs) {
189
188
return *this ;
190
189
}
0 commit comments