add locks around Socket::send and Socket::recv to see if it helps with thread sanitizer error in Linux CI

This commit is contained in:
Benjamin Sergeant 2019-04-19 14:28:51 -07:00
parent 0ba2e2ce96
commit b0139c2217

View File

@ -160,6 +160,8 @@ namespace ix
ssize_t Socket::send(char* buffer, size_t length)
{
std::lock_guard<std::mutex> lock(_socketMutex);
int flags = 0;
#ifdef MSG_NOSIGNAL
flags = MSG_NOSIGNAL;
@ -175,6 +177,8 @@ namespace ix
ssize_t Socket::recv(void* buffer, size_t length)
{
std::lock_guard<std::mutex> lock(_socketMutex);
int flags = 0;
#ifdef MSG_NOSIGNAL
flags = MSG_NOSIGNAL;