From 0dd0ea7eda7c4ab0bcdf94d0020567efe7c15467 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 24 May 2020 02:45:11 -0400 Subject: [PATCH] race in connection state when setting a handler on a different thread Former-commit-id: 42c7677690c434168135992429f7521239475ef8 --- src/connection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/connection.h b/src/connection.h index 10f9e322b..f5624b596 100644 --- a/src/connection.h +++ b/src/connection.h @@ -31,6 +31,8 @@ #ifndef __REDIS_CONNECTION_H #define __REDIS_CONNECTION_H +#include + #define CONN_INFO_LEN 32 struct aeEventLoop; @@ -70,7 +72,7 @@ typedef struct ConnectionType { struct connection { ConnectionType *type; - ConnectionState state; + std::atomic state; short int flags; short int refs; int last_errno;