diff --git a/speechx/speechx/common/frontend/feature_cache.cc b/speechx/speechx/common/frontend/feature_cache.cc index bf76aaff4..d39391d05 100644 --- a/speechx/speechx/common/frontend/feature_cache.cc +++ b/speechx/speechx/common/frontend/feature_cache.cc @@ -45,21 +45,11 @@ bool FeatureCache::Read(std::vector* feats) { } while (result); } - //while (cache_.empty() && base_extractor_->IsFinished() == false) { - //// todo refactor: wait - //// ready_read_condition_.wait(lock); - //int32 elapsed = static_cast(timer.Elapsed() * 1000); // ms - //if (elapsed > timeout_) { - //return false; - //} - //usleep(100); // sleep 0.1 ms - //} if (cache_.empty()) return false; // read from cache *feats = cache_.front(); cache_.pop(); - //ready_feed_condition_.notify_one(); VLOG(1) << "FeatureCache::Read cost: " << timer.Elapsed() << " sec."; return true; } @@ -81,16 +71,9 @@ bool FeatureCache::Compute() { vector feature_chunk(feature.data() + start, feature.data() + start + dim_); - // std::unique_lock lock(mutex_); - //while (cache_.size() >= max_size_) { - // cache full, wait - // ready_feed_condition_.wait(lock); - //} - // feed cache cache_.push(feature_chunk); ++nframe_; - //ready_read_condition_.notify_one(); } VLOG(1) << "FeatureCache::Compute cost: " << timer.Elapsed() << " sec. "