Fix race condition in socket close

pull/2216/head^2
Christopher Haster 2016-04-19 20:43:18 -05:00
parent fc71badb69
commit cd4a521e22
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,9 @@ int Socket::close()
return 0;
}
void *socket = _socket;
_iface->socket_attach(_socket, 0, 0);
void *volatile socket = _socket;
_socket = 0;
return _iface->socket_close(socket);
}