From 38b53b37b491f1dccf9133e710198e3d0af34535 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 28 Mar 2018 19:37:10 +0800 Subject: [PATCH] Remove Pop method --- .../framework/details/threaded_ssa_graph_executor.cc | 2 +- .../framework/details/threaded_ssa_graph_executor.h | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc index a6998f45df2..2603aed62ac 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc @@ -125,7 +125,7 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( // 2. Find ready variable bool timeout; - auto cur_ready_vars = ready_vars.PopAll(100, &timeout); + auto cur_ready_vars = ready_vars.PopAll(1000, &timeout); if (timeout) { if (exception_) { diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.h b/paddle/fluid/framework/details/threaded_ssa_graph_executor.h index da559d85535..2ea57ac8f96 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.h +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.h @@ -47,16 +47,6 @@ class BlockingQueue { cv_.notify_all(); } - T Pop() { - std::unique_lock lock(mutex_); - while (q_.empty()) { - cv_.wait(lock); - } - T v = q_.front(); - q_.pop_front(); - return v; - } - std::deque PopAll(size_t ms, bool *timeout) { auto time = std::chrono::system_clock::now() + std::chrono::milliseconds(ms); -- GitLab