mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
It is time to enable nested namespaces in the code. Pull Request resolved: https://github.com/pytorch/pytorch/pull/118506 Approved by: https://github.com/albanD
22 lines
447 B
C++
22 lines
447 B
C++
#include <c10/core/impl/HermeticPyObjectTLS.h>
|
|
|
|
namespace c10::impl {
|
|
|
|
thread_local std::atomic<bool> hermeticPyObjectState{false};
|
|
|
|
std::atomic<bool> HermeticPyObjectTLS::haveState_{false};
|
|
|
|
void HermeticPyObjectTLS::set_state(bool state) {
|
|
hermeticPyObjectState = state;
|
|
}
|
|
|
|
bool HermeticPyObjectTLS::get_tls_state() {
|
|
return hermeticPyObjectState;
|
|
}
|
|
|
|
void HermeticPyObjectTLS::init_state() {
|
|
haveState_ = true;
|
|
}
|
|
|
|
} // namespace c10::impl
|