stringid: remove explicit synchronisation
It is more appropriate to synchronise externally, and it simplifies building across mingw which lacks std::mutex and friends.
This commit is contained in:
parent
e85c31f526
commit
947ec5cdb2
@ -17,7 +17,6 @@
|
|||||||
#include "stringid.hpp"
|
#include "stringid.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
using util::stringid;
|
using util::stringid;
|
||||||
|
|
||||||
@ -29,9 +28,6 @@ stringid::add (const std::string key) {
|
|||||||
if (pos != m_map.end ())
|
if (pos != m_map.end ())
|
||||||
throw std::invalid_argument ("duplicate stringid key");
|
throw std::invalid_argument ("duplicate stringid key");
|
||||||
|
|
||||||
static std::mutex s_lock;
|
|
||||||
std::lock_guard<std::mutex> guard (s_lock);
|
|
||||||
|
|
||||||
id_t id = m_map.size ();
|
id_t id = m_map.size ();
|
||||||
m_map[key] = id;
|
m_map[key] = id;
|
||||||
return id;
|
return id;
|
||||||
|
Loading…
Reference in New Issue
Block a user