From cff8386147356176228b8c56573005bca2b65d0a Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 18 Nov 2018 21:25:05 -0500 Subject: fix data race in feed() --- include/salticidae/conn.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index 2dab517..777c480 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -187,6 +187,8 @@ class ConnPool { } void feed(const conn_t &conn, int client_fd) { + /* the caller should finalize all the preparation */ + std::atomic_thread_fence(std::memory_order_release); tcall.async_call([this, conn, client_fd](ThreadCall::Handle &) { if (conn->mode == Conn::ConnMode::DEAD) { -- cgit v1.2.3