24 #ifndef PXR_BASE_TF_PY_LOCK_H
25 #define PXR_BASE_TF_PY_LOCK_H
29 #ifdef PXR_PYTHON_SUPPORT_ENABLED
139 TF_API void BeginAllowThreads();
143 TF_API void EndAllowThreads();
147 friend struct TfPyEnsureGILUnlockedObj;
148 enum _UnlockedTag { _ConstructUnlocked };
149 explicit TfPyLock(_UnlockedTag);
151 PyGILState_STATE _gilState;
152 PyThreadState *_savedState;
154 bool _allowingThreads:1;
158 struct TfPyEnsureGILUnlockedObj
162 TF_API TfPyEnsureGILUnlockedObj();
190 #define TF_PY_ALLOW_THREADS_IN_SCOPE() \
191 TfPyEnsureGILUnlockedObj __py_lock_allow_threads__
198 #define TF_PY_ALLOW_THREADS_IN_SCOPE()
200 #endif // PXR_PYTHON_SUPPORT_ENABLED
202 #endif // PXR_BASE_TF_PY_LOCK_H
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE