1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +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:
Josiah VanderZee 2025-05-22 17:02:22 -05:00
parent 30e33d71cc
commit 4215065338
No known key found for this signature in database
GPG key ID: C7BB8573A4ABC4B9

View file

@ -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