mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
update tls
This commit is contained in:
parent
ca6815c601
commit
5784b29521
@ -61,9 +61,9 @@ public:
|
||||
|
||||
template <typename... P>
|
||||
T* create(P&&... params) {
|
||||
auto ptr = static_cast<T*>(*this);
|
||||
thread_local auto ptr = static_cast<T*>(*this);
|
||||
if (ptr == nullptr) {
|
||||
return (*this) = new T(std::forward<P>(params)...);
|
||||
return ptr = (*this) = new T(std::forward<P>(params)...);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user