同步操作将从 OpenHarmony-SIG/python 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* Thread and interpreter state structures and their interfaces */#ifndef Py_PYSTATE_H#define Py_PYSTATE_H#ifdef __cplusplusextern "C" {#endif#include "pythread.h"/* This limitation is for performance and simplicity. If needed it can beremoved (with effort). */#define MAX_CO_EXTRA_USERS 255/* Forward declarations for PyFrameObject, PyThreadStateand PyInterpreterState */struct _frame;struct _ts;struct _is;/* struct _ts is defined in cpython/pystate.h */typedef struct _ts PyThreadState;/* struct _is is defined in internal/pycore_pystate.h */typedef struct _is PyInterpreterState;PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000/* New in 3.8 */PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *);#endif#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000/* New in 3.7 */PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);#endif#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000/* State unique per thread *//* New in 3.3 */PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*);PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*);#endifPyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*);PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);/* Get the current thread state.When the current thread state is NULL, this issues a fatal error (so thatthe caller needn't check for NULL).The caller must hold the GIL.See also PyThreadState_GET() and _PyThreadState_GET(). */PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);/* Get the current Python thread state.Macro using PyThreadState_Get() or _PyThreadState_GET() depending ifpycore_pystate.h is included or not (this header redefines the macro).If PyThreadState_Get() is used, issue a fatal error if the current threadstate is NULL.See also PyThreadState_Get() and _PyThreadState_GET(). */#define PyThreadState_GET() PyThreadState_Get()PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *);typedefenum {PyGILState_LOCKED, PyGILState_UNLOCKED}PyGILState_STATE;/* Ensure that the current thread is ready to call the PythonC API, regardless of the current state of Python, or of itsthread lock. This may be called as many times as desiredby a thread so long as each call is matched with a call toPyGILState_Release(). In general, other thread-state APIs maybe used between _Ensure() and _Release() calls, so long as thethread-state is restored to its previous state before the Release().For example, normal use of the Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS macros are acceptable.The return value is an opaque "handle" to the thread state whenPyGILState_Ensure() was called, and must be passed toPyGILState_Release() to ensure Python is left in the same state. Eventhough recursive calls are allowed, these handles can *not* be shared -each unique call to PyGILState_Ensure must save the handle for itscall to PyGILState_Release.When the function returns, the current thread will hold the GIL.Failure is a fatal error.*/PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);/* Release any resources previously acquired. After this call, Python'sstate will be the same as it was prior to the correspondingPyGILState_Ensure() call (but generally this state will be unknown tothe caller, hence the use of the GILState API.)Every call to PyGILState_Ensure must be matched by a call toPyGILState_Release on the same thread.*/PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);/* Helper/diagnostic function - get the current thread state forthis thread. May return NULL if no GILState API has been usedon the current thread. Note that the main thread always has such athread-state, even if no auto-thread-state call has been madeon the main thread.*/PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);#ifndef Py_LIMITED_API# define Py_CPYTHON_PYSTATE_H# include "cpython/pystate.h"# undef Py_CPYTHON_PYSTATE_H#endif#ifdef __cplusplus}#endif#endif /* !Py_PYSTATE_H */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。