Fix race condition in socket close

Christopher Haster 2016-04-19 20:43:18 -05:00 committed by Russ Butler
parent 16929af278
commit f4526e5b73
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);
}