Make global instance init thread-safe.

Use local statics except for Visual C++ < 2015.
This commit is contained in:
Peter Johnson
2015-07-20 23:36:22 -07:00
parent 5df62ac172
commit b4c65dc210
5 changed files with 59 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ using namespace nt;
#define DEBUG(str) puts(str)
std::unique_ptr<Dispatcher> Dispatcher::m_instance;
ATOMIC_STATIC_INIT(Dispatcher)
Dispatcher::Dispatcher()
: m_server(false),