diff --git a/src/media/socket_pair.h b/src/media/socket_pair.h
index 9c5de10df20f2988d643bb242fd49e9b853066f9..b1df9343eae7ef2455b76ff4c3cd0a086fdb5d16 100644
--- a/src/media/socket_pair.h
+++ b/src/media/socket_pair.h
@@ -36,8 +36,10 @@
 
 #include <sys/socket.h>
 #include <mutex>
-#include <stdint.h>
 #include <memory>
+#include <atomic>
+
+#include <cstdint>
 
 namespace ring {
 
@@ -99,7 +101,7 @@ class SocketPair {
         socklen_t rtpDestAddrLen_;
         sockaddr_storage rtcpDestAddr_;
         socklen_t rtcpDestAddrLen_;
-        bool interrupted_ {false};
+        std::atomic_bool interrupted_ {false};
         std::unique_ptr<SRTPProtoContext> srtpContext_;
 };