diff --git a/worker/include/DepLibUring.hpp b/worker/include/DepLibUring.hpp index a0b041c899..c41f308eed 100644 --- a/worker/include/DepLibUring.hpp +++ b/worker/include/DepLibUring.hpp @@ -52,7 +52,7 @@ class DepLibUring class LibUring; // Whether liburing is enabled or not after runtime checks. - static bool enabled; + thread_local static bool enabled; thread_local static LibUring* liburing; public: diff --git a/worker/src/DepLibUring.cpp b/worker/src/DepLibUring.cpp index 8ad9bc8555..0195ce7b9e 100644 --- a/worker/src/DepLibUring.cpp +++ b/worker/src/DepLibUring.cpp @@ -11,7 +11,7 @@ #include /* Static variables. */ -bool DepLibUring::enabled{ false }; +thread_local bool DepLibUring::enabled{ false }; // liburing instance per thread. thread_local DepLibUring::LibUring* DepLibUring::liburing{ nullptr }; // Completion queue entry array used to retrieve processes tasks.