From 2ef9c99438e5c87651332f47c98da8d397b030e3 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 3 Jul 2019 00:42:21 -0400 Subject: throw exception when attempt to call on stopped ThreadCall --- include/salticidae/conn.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/salticidae/conn.h') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index 0058274..6b9b486 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -460,13 +460,13 @@ class ConnPool { disp_tcall = workers[0].get_tcall(); workers[0].set_dispatcher(); disp_error_cb = [this](const std::exception_ptr err) { + workers[0].stop_tcall(); + disp_ec.stop(); user_tcall->async_call([this, err](ThreadCall::Handle &) { stop_workers(); //std::rethrow_exception(err); if (error_cb) error_cb(err, true, -1); }); - disp_ec.stop(); - workers[0].stop_tcall(); }; worker_error_cb = [this](const std::exception_ptr err) { -- cgit v1.2.3