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:
parent
419c395966
commit
5370201df8
@ -160,6 +160,8 @@ namespace ix
|
|||||||
|
|
||||||
ssize_t Socket::send(char* buffer, size_t length)
|
ssize_t Socket::send(char* buffer, size_t length)
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_socketMutex);
|
||||||
|
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
#ifdef MSG_NOSIGNAL
|
#ifdef MSG_NOSIGNAL
|
||||||
flags = MSG_NOSIGNAL;
|
flags = MSG_NOSIGNAL;
|
||||||
@ -175,6 +177,8 @@ namespace ix
|
|||||||
|
|
||||||
ssize_t Socket::recv(void* buffer, size_t length)
|
ssize_t Socket::recv(void* buffer, size_t length)
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_socketMutex);
|
||||||
|
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
#ifdef MSG_NOSIGNAL
|
#ifdef MSG_NOSIGNAL
|
||||||
flags = MSG_NOSIGNAL;
|
flags = MSG_NOSIGNAL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user