mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make MTP server shutdown flag atomic
I noticed this potential data race while reading the code. I have not detected it with TSan in practice.
This commit is contained in:
parent
1214a1d4a6
commit
e9b32843a5
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "util/numeric.h"
|
||||
#include "porting.h"
|
||||
#include "network/networkprotocol.h"
|
||||
#include <atomic>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
@ -301,7 +302,7 @@ private:
|
|||
// Backwards compatibility
|
||||
PeerHandler *m_bc_peerhandler;
|
||||
|
||||
bool m_shutting_down = false;
|
||||
std::atomic<bool> m_shutting_down = false;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue