From 335e4b9d52a978aa6a7a845a24b044ab0927c91e Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Wed, 11 Jul 2018 20:17:10 +0800 Subject: [PATCH] fix a dead lock bug --- paddle/fluid/framework/details/threaded_ssa_graph_executor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc index 8a8c3a593..07097c7e7 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc @@ -100,11 +100,13 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( auto cur_ready_vars = ready_vars.PopAll(1, &timeout); if (timeout) { - std::lock_guard l(exception_mu_); + std::unique_lock l(exception_mu_); if (exception_) { + l.unlock(); for (auto &run_op_future : run_op_futures_) { run_op_future.wait(); } + l.lock(); std::exception *exp = exception_.get(); if (dynamic_cast(exp)) { auto e = *static_cast(exp); -- GitLab