mirror of
https://github.com/python/cpython.git
synced 2024-11-25 09:39:56 +01:00
8f17d69b7b
This makes the following macros public as part of the non-limited C-API for locking a single object or two objects at once. * `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()` * `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()` The supporting functions and structs used by the macros are also exposed for cases where C macros are not available.
17 lines
314 B
C
17 lines
314 B
C
#ifndef Py_CRITICAL_SECTION_H
|
|
#define Py_CRITICAL_SECTION_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef Py_LIMITED_API
|
|
# define Py_CPYTHON_CRITICAL_SECTION_H
|
|
# include "cpython/critical_section.h"
|
|
# undef Py_CPYTHON_CRITICAL_SECTION_H
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_CRITICAL_SECTION_H */
|