/
opt
/
imh
/
python3.13
/
include
/
python3.13
/
cpython
/
/opt/imh/python3.13/include/python3.13/cpython
mkdir
upload
Name
Size
Mode
Actions
abstract.h
3399
0644
edit
dl
rm
bytearrayobject.h
1163
0644
edit
dl
rm
bytesobject.h
1180
0644
edit
dl
rm
cellobject.h
1076
0644
edit
dl
rm
ceval.h
1115
0644
edit
dl
rm
classobject.h
2245
0644
edit
dl
rm
code.h
15207
0644
edit
dl
rm
compile.h
2121
0644
edit
dl
rm
complexobject.h
909
0644
edit
dl
rm
context.h
1837
0644
edit
dl
rm
critical_section.h
5588
0644
edit
dl
rm
descrobject.h
1593
0644
edit
dl
rm
dictobject.h
3870
0644
edit
dl
rm
fileobject.h
652
0644
edit
dl
rm
fileutils.h
232
0644
edit
dl
rm
floatobject.h
900
0644
edit
dl
rm
frameobject.h
1199
0644
edit
dl
rm
funcobject.h
7049
0644
edit
dl
rm
genobject.h
2997
0644
edit
dl
rm
import.h
725
0644
edit
dl
rm
initconfig.h
8197
0644
edit
dl
rm
listobject.h
1801
0644
edit
dl
rm
lock.h
1763
0644
edit
dl
rm
longintrepr.h
5119
0644
edit
dl
rm
longobject.h
5583
0644
edit
dl
rm
memoryobject.h
2223
0644
edit
dl
rm
methodobject.h
2276
0644
edit
dl
rm
modsupport.h
1042
0644
edit
dl
rm
monitoring.h
7704
0644
edit
dl
rm
object.h
19074
0644
edit
dl
rm
objimpl.h
3820
0644
edit
dl
rm
odictobject.h
1311
0644
edit
dl
rm
picklebufobject.h
848
0644
edit
dl
rm
pthread_stubs.h
3926
0644
edit
dl
rm
pyatomic.h
16506
0644
edit
dl
rm
pyatomic_gcc.h
19131
0644
edit
dl
rm
pyatomic_msc.h
29241
0644
edit
dl
rm
pyatomic_std.h
24336
0644
edit
dl
rm
pyctype.h
1387
0644
edit
dl
rm
pydebug.h
1413
0644
edit
dl
rm
pyerrors.h
2908
0644
edit
dl
rm
pyfpe.h
444
0644
edit
dl
rm
pyframe.h
1947
0644
edit
dl
rm
pyhash.h
1382
0644
edit
dl
rm
pylifecycle.h
2817
0644
edit
dl
rm
pymem.h
2843
0644
edit
dl
rm
pystate.h
9465
0644
edit
dl
rm
pystats.h
5434
0644
edit
dl
rm
pythonrun.h
4327
0644
edit
dl
rm
pythread.h
1510
0644
edit
dl
rm
pytime.h
707
0644
edit
dl
rm
setobject.h
2046
0644
edit
dl
rm
sysmodule.h
775
0644
edit
dl
rm
traceback.h
282
0644
edit
dl
rm
tracemalloc.h
823
0644
edit
dl
rm
tupleobject.h
1329
0644
edit
dl
rm
unicodeobject.h
25074
0644
edit
dl
rm
warnings.h
695
0644
edit
dl
rm
weakrefobject.h
2249
0644
edit
dl
rm
Edit:
/opt/imh/python3.13/include/python3.13/cpython/lock.h
(1763B)
#ifndef Py_CPYTHON_LOCK_H # error "this header file must not be included directly" #endif #define _Py_UNLOCKED 0 #define _Py_LOCKED 1 // A mutex that occupies one byte. The lock can be zero initialized to // represent the unlocked state. // // Typical initialization: // PyMutex m = (PyMutex){0}; // // Or initialize as global variables: // static PyMutex m; // // Typical usage: // PyMutex_Lock(&m); // ... // PyMutex_Unlock(&m); // // The contents of the PyMutex are not part of the public API, but are // described to aid in understanding the implementation and debugging. Only // the two least significant bits are used. The remaining bits are always zero: // 0b00: unlocked // 0b01: locked // 0b10: unlocked and has parked threads // 0b11: locked and has parked threads typedef struct PyMutex { uint8_t _bits; // (private) } PyMutex; // exported function for locking the mutex PyAPI_FUNC(void) PyMutex_Lock(PyMutex *m); // exported function for unlocking the mutex PyAPI_FUNC(void) PyMutex_Unlock(PyMutex *m); // Locks the mutex. // // If the mutex is currently locked, the calling thread will be parked until // the mutex is unlocked. If the current thread holds the GIL, then the GIL // will be released while the thread is parked. static inline void _PyMutex_Lock(PyMutex *m) { uint8_t expected = _Py_UNLOCKED; if (!_Py_atomic_compare_exchange_uint8(&m->_bits, &expected, _Py_LOCKED)) { PyMutex_Lock(m); } } #define PyMutex_Lock _PyMutex_Lock // Unlocks the mutex. static inline void _PyMutex_Unlock(PyMutex *m) { uint8_t expected = _Py_LOCKED; if (!_Py_atomic_compare_exchange_uint8(&m->_bits, &expected, _Py_UNLOCKED)) { PyMutex_Unlock(m); } } #define PyMutex_Unlock _PyMutex_Unlock
Save
cmd:
run