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
@ -12,6 +12,7 @@
|
|||||||
#include "util/numeric.h"
|
#include "util/numeric.h"
|
||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
#include "network/networkprotocol.h"
|
#include "network/networkprotocol.h"
|
||||||
|
#include <atomic>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -301,7 +302,7 @@ private:
|
|||||||
// Backwards compatibility
|
// Backwards compatibility
|
||||||
PeerHandler *m_bc_peerhandler;
|
PeerHandler *m_bc_peerhandler;
|
||||||
|
|
||||||
bool m_shutting_down = false;
|
std::atomic<bool> m_shutting_down = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user