PNG  IHDR  8] PLTE S =tRNS   PNG  IHDR  8] PLTE S =tRNS   REDROOM
PHP 7.4.33
Preview: pystate.h Size: 4.53 KB
/opt/alt/python311/include/python3.11/pystate.h

/* Thread and interpreter state structures and their interfaces */


#ifndef Py_PYSTATE_H
#define Py_PYSTATE_H
#ifdef __cplusplus
extern "C" {
#endif

/* This limitation is for performance and simplicity. If needed it can be
removed (with effort). */
#define MAX_CO_EXTRA_USERS 255

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 >= 0x03090000
/* New in 3.9 */
/* Get the current interpreter state.

   Issue a fatal error if there no current Python thread state or no current
   interpreter. It cannot return NULL.

   The caller must hold the GIL. */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Get(void);
#endif

#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*, PyModuleDef*);
PyAPI_FUNC(int) PyState_RemoveModule(PyModuleDef*);
#endif
PyAPI_FUNC(PyObject*) PyState_FindModule(PyModuleDef*);

PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);

/* Get the current thread state.

   When the current thread state is NULL, this issues a fatal error (so that
   the caller needn't check for NULL).

   The caller must hold the GIL.

   See also _PyThreadState_UncheckedGet() and _PyThreadState_GET(). */
PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);

// Alias to 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 *);

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
/* New in 3.9 */
PyAPI_FUNC(PyInterpreterState*) PyThreadState_GetInterpreter(PyThreadState *tstate);
PyAPI_FUNC(PyFrameObject*) PyThreadState_GetFrame(PyThreadState *tstate);
PyAPI_FUNC(uint64_t) PyThreadState_GetID(PyThreadState *tstate);
#endif

typedef
    enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
        PyGILState_STATE;


/* Ensure that the current thread is ready to call the Python
   C API, regardless of the current state of Python, or of its
   thread lock.  This may be called as many times as desired
   by a thread so long as each call is matched with a call to
   PyGILState_Release().  In general, other thread-state APIs may
   be used between _Ensure() and _Release() calls, so long as the
   thread-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 when
   PyGILState_Ensure() was called, and must be passed to
   PyGILState_Release() to ensure Python is left in the same state. Even
   though recursive calls are allowed, these handles can *not* be shared -
   each unique call to PyGILState_Ensure must save the handle for its
   call 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's
   state will be the same as it was prior to the corresponding
   PyGILState_Ensure() call (but generally this state will be unknown to
   the caller, hence the use of the GILState API.)

   Every call to PyGILState_Ensure must be matched by a call to
   PyGILState_Release on the same thread.
*/
PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);

/* Helper/diagnostic function - get the current thread state for
   this thread.  May return NULL if no GILState API has been used
   on the current thread.  Note that the main thread always has such a
   thread-state, even if no auto-thread-state call has been made
   on 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 */

Directory Contents

Dirs: 2 × Files: 74

Name Size Perms Modified Actions
cpython DIR
- drwxr-xr-x 2026-06-04 10:22:34
Edit Download
internal DIR
- drwxr-xr-x 2026-06-04 10:22:34
Edit Download
30.67 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
264 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.18 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.43 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.56 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
6.11 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
6.91 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
520 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
724 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
9.41 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.23 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
3.76 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
21.94 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
253 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.74 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.07 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.53 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
507 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.49 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
336 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
334 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.95 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
772 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
593 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.74 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
3.65 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
827 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.74 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
4.95 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
6.39 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.32 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
29.10 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
8.23 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
10.92 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
737 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
291 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.27 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
5.00 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.68 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
51.95 KB lrw-r--r-- 2026-04-17 12:21:39
Edit Download
162 B lrw-r--r-- 2026-04-17 12:36:42
Edit Download
2.36 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
12.48 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.78 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
551 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
4.06 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.20 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.92 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
5.92 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.93 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
3.80 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
23.88 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
4.53 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
436 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.52 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.79 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.16 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
4.72 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
851 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.41 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
628 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.51 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.46 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.99 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.36 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.35 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.61 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
583 B lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.09 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.58 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
2.29 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
35.19 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.10 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download
1.20 KB lrw-r--r-- 2026-03-03 00:52:57
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
 !"#$%&'(()*+,-./00123456789 t\ wIDATx ]ys  47Y ƒ -  "  Rv  < f{Ɛ $k l L > L  ~h^ 1  [  r G t& h  l F z3O Y ! p A(_g̷ E8 )S 8 c  Kb"z ~ 5 J xAL WU <  *  5 m;W a pB h ~P J 2 3 6 ҙ .Ƹ P i  4g F R L P ΪK/D  M v (a3 k J Œ4N5* SH ` SdJ z  O J Xՠ V>u ߱ BE&L b2 ?2` tX+  c CB A$ i b C ĀMB E : /  # Dx &l =q Ty  0 \p I ( L Ǎ { e 4k ;`u^ヲ eP!( d {  )T A 8 O;Ě n >;s6 !  :Nx `[S D HU ~ q›J F} a g*D 49 / pn k h (t 8NxƐF _!r չ7 ZR R׷ q/5") Ӎ NY 0 x sZ!   o  fu  ,  K"$ ? pg  㕣=  1» {h " fh7    y  } € +7  $ y " X —ą - G P u 4 m >J 5 L =V ' ^@I p ?MS xЌ XV P ! h "C NS9B8̢ ]!K  e   zA , ӏkbY  !< XQ ٿyS| *" f { w  4@[S <  # 0 ! js [m  =,~ o "ݎ DHf Wo $ g ! Vԅ t mB /y Wf V4񺍸 c+@x?  B ~u " xUN e 0 BĂ) ~J pz! 7y6]l Ԥ@ P a< O /DHC `≻  N m"$  0ObB }{ x AO FCG D R ^ "B  { WDH  UR l@ T #  +"d T ; 0 i  D}. 7 ` ' ] w rE &S i ƕiTD EL P _ u h $ Ա FG wVD G L R Zf ' .!] J /ZR oGЍs Mr Ĥ ʬ 3 Q [3 cL ` ^ p + ( F;# B 5 '  2Y f [  ϶R0e }  E 7 6M aۮ H <& n % L] E}Up x紉, Uw' Q  Ǯշo k ވۙ 0N94 VX5 xEDE l D #֤ } C o )W :  ^ s 9  bRf iX5u ཱི 4 :[  T 1. | [E 2ؽ Iy\ : o x K G 5 ylP ' uK E ftb/i[3 .g _  [3M n G, #NwQ5~  ؚ) | n =Ц"x qg gB ` 듘 ~ x w ? ? R~  _ u. &VQ K˻   H C ( TN˄+ `C dA nB׭ D 3"Z G ê ^k H_ /- ~ " R_  .8 Z_ 6@ o  xg  uP ? 3լ @7AM!  E7^ - =V L  x  g-D0  CtmW 7  O  G _ WD0 g C  w1 r d w : a | \  *" f nֳ ^ H# f L ` Z ۽hV  }S F r0Ù Bć5r] @! NL iQ]{s^=4 d  WD  "  "   M; t" 8 5 e dL| "-*st" ) SWD ?R[S e ooF  20.D ? bo =) A i o d ģ ZҰaO @E =) i D a &ܟa CϞ y6 ,<%{^x%{f8? `iw^ ?/ M * IEND B`