Skip to content

Commit

Permalink
[src] Fix bug in newly refactored threading code
Browse files Browse the repository at this point in the history
  • Loading branch information
danpovey committed May 27, 2017
1 parent e9646f0 commit 93c069c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/util/kaldi-thread.h
Expand Up @@ -75,9 +75,8 @@ class MultiThreadable {
// Does the main function of the class
// Subclasses have to redefine this
virtual ~MultiThreadable();
// Optional destructor. Note: the destructor
// the object passed by the user will also be called, so
// watch out.
// Optional destructor. Note: the destructor of the object passed by the user
// will also be called, so watch out.

public:
// Do not redeclare thread_id_ and num_threads_ in derived classes.
Expand Down Expand Up @@ -130,7 +129,7 @@ class MultiThreader {
for (int32 i = 0; i < threads_.size(); i++) {
cvec_[i].thread_id_ = i;
cvec_[i].num_threads_ = threads_.size();
threads_[i] = std::thread(cvec_[i]);
threads_[i] = std::thread(std::ref(cvec_[i]));
}
}
}
Expand Down

0 comments on commit 93c069c

Please sign in to comment.