socket_pair: avoid potential race condition

Refs #67228

Change-Id: Id74a19ab8dce01d132555840b05f3165cffb44af
This commit is contained in:
Adrien Béraud
2015-03-23 13:46:19 -04:00
committed by Gerrit Code Review
parent 8face96729
commit 755f8694c5

View File

@ -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_;
};