Skip to content

Commit 44980dd

Browse files
authored
[src] Fix incorrect invocation of mutex in nnet-batch-compute code (#2932)
1 parent 78f0127 commit 44980dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/nnet3/nnet-batch-compute.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ NnetBatchComputer::GetHighestPriorityComputation(
135135
int32 *minibatch_size_out,
136136
std::vector<NnetInferenceTask*> *tasks) {
137137
tasks->clear();
138-
std::unique_lock<std::mutex>(mutex_);
138+
std::unique_lock<std::mutex> lock(mutex_);
139139
MapType::iterator iter = tasks_.begin(), end = tasks_.end(),
140140
best_iter = tasks_.end();
141141
double highest_priority = -std::numeric_limits<double>::infinity();

src/nnet3/nnet-compute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class NnetComputer {
119119

120120
// Version of GetOutput that calls Swap(), destroying the output stored inside
121121
// this object. You should probably not use this if you plan to call
122-
// Backward() on the same NnetComputer object, or it's a recurret
122+
// Backward() on the same NnetComputer object, or it's a recurrent
123123
// computation-- it may lead to a crash.
124124
void GetOutputDestructive(const std::string &output_name,
125125
CuMatrix<BaseFloat> *output);

0 commit comments

Comments
 (0)