mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-26 01:18:01 -05:00
Made the ID system thread safe
This commit is contained in:
parent
a5bbf6a40c
commit
58402e9b7b
2 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ namespace geode::utils::web {
|
||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
|
|
||||||
static size_t m_idCounter;
|
static std::atomic_size_t s_idCounter;
|
||||||
std::shared_ptr<Impl> m_impl;
|
std::shared_ptr<Impl> m_impl;
|
||||||
const size_t m_id;
|
const size_t m_id;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -212,9 +212,9 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t WebRequest::m_idCounter = 0;
|
std::atomic_size_t WebRequest::s_idCounter = 0;
|
||||||
|
|
||||||
WebRequest::WebRequest() : m_impl(std::make_shared<Impl>()), m_id(WebRequest::m_idCounter++) {}
|
WebRequest::WebRequest() : m_impl(std::make_shared<Impl>()), m_id(WebRequest::s_idCounter++) {}
|
||||||
WebRequest::~WebRequest() {}
|
WebRequest::~WebRequest() {}
|
||||||
|
|
||||||
// Encodes a url param
|
// Encodes a url param
|
||||||
|
|
Loading…
Reference in a new issue