recursive mutex + enable test that was breaking on Ubuntu Xenial + gcc + tsan

This commit is contained in:
Benjamin Sergeant
2019-05-15 16:01:05 -07:00
parent d91c896e46
commit 09956d7500
3 changed files with 7 additions and 7 deletions

View File

@ -152,7 +152,7 @@ namespace ix
std::string errorMsg;
{
bool tls = protocol == "wss";
std::lock_guard<std::mutex> lock(_socketMutex);
std::lock_guard<std::recursive_mutex> lock(_socketMutex);
_socket = createSocket(tls, errorMsg);
if (!_socket)
@ -184,7 +184,7 @@ namespace ix
std::string errorMsg;
{
std::lock_guard<std::mutex> lock(_socketMutex);
std::lock_guard<std::recursive_mutex> lock(_socketMutex);
_socket = createSocket(fd, errorMsg);
if (!_socket)
@ -956,7 +956,7 @@ namespace ix
ssize_t WebSocketTransport::send()
{
std::lock_guard<std::mutex> lock(_socketMutex);
std::lock_guard<std::recursive_mutex> lock(_socketMutex);
return _socket->send((char*)&_txbuf[0], _txbuf.size());
}
@ -1010,7 +1010,7 @@ namespace ix
void WebSocketTransport::closeSocket()
{
std::lock_guard<std::mutex> lock(_socketMutex);
std::lock_guard<std::recursive_mutex> lock(_socketMutex);
_socket->close();
}

View File

@ -154,7 +154,7 @@ namespace ix
// Underlying TCP socket
std::shared_ptr<Socket> _socket;
std::mutex _socketMutex;
std::recursive_mutex _socketMutex;
// Hold the state of the connection (OPEN, CLOSED, etc...)
std::atomic<ReadyState> _readyState;