diff --git a/src/system/SystemLayer.h b/src/system/SystemLayer.h index 7d146bec4c0461..832a21c278d9d5 100644 --- a/src/system/SystemLayer.h +++ b/src/system/SystemLayer.h @@ -41,6 +41,7 @@ #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING +#include #include #endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING @@ -204,7 +205,7 @@ class DLL_EXPORT Layer WatchableEventManager mWatchableEvents; WakeEvent mWakeEvent; #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING - pthread_t mHandleSelectThread; + std::atomic mHandleSelectThread; #endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK