From 755f8694c5c5a669d94eaf7cf968d4c5271c5544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Mon, 23 Mar 2015 13:46:19 -0400 Subject: [PATCH] socket_pair: avoid potential race condition Refs #67228 Change-Id: Id74a19ab8dce01d132555840b05f3165cffb44af --- src/media/socket_pair.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/media/socket_pair.h b/src/media/socket_pair.h index 9c5de10df2..b1df9343ea 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_; }; -- GitLab