From 8d242e0112c7f9072600a48366ebbd6ce7b5c727 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 28 Jun 2019 22:49:03 -0400 Subject: fix data race in timers --- include/salticidae/conn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/salticidae/conn.h') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index b693b4f..c34521a 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -115,6 +115,7 @@ class ConnPool { Conn(Conn &&other) = delete; virtual ~Conn() { + std::atomic_thread_fence(std::memory_order_acquire); SALTICIDAE_LOG_INFO("destroyed %s", std::string(*this).c_str()); } @@ -251,7 +252,6 @@ class ConnPool { /* the caller should finalize all the preparation */ tcall.async_call([this, conn, client_fd](ThreadCall::Handle &) { try { - conn->ev_connect.clear(); assert(conn->mode != Conn::ConnMode::DEAD); auto cpool = conn->cpool; if (cpool->enable_tls) -- cgit v1.2.3