mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-111956: Add thread-safe one-time initialization. (gh-111960)
This commit is contained in:
parent
f66afa395a
commit
446f18a911
11 changed files with 1061 additions and 955 deletions
|
@ -1,5 +1,8 @@
|
|||
#ifndef Py_INTERNAL_MODSUPPORT_H
|
||||
#define Py_INTERNAL_MODSUPPORT_H
|
||||
|
||||
#include "pycore_lock.h" // _PyOnceFlag
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -65,15 +68,16 @@ PyAPI_FUNC(void) _PyArg_BadArgument(
|
|||
// --- _PyArg_Parser API ---------------------------------------------------
|
||||
|
||||
typedef struct _PyArg_Parser {
|
||||
int initialized;
|
||||
const char *format;
|
||||
const char * const *keywords;
|
||||
const char *fname;
|
||||
const char *custom_msg;
|
||||
int pos; /* number of positional-only arguments */
|
||||
int min; /* minimal number of arguments */
|
||||
int max; /* maximal number of positional arguments */
|
||||
PyObject *kwtuple; /* tuple of keyword parameter names */
|
||||
_PyOnceFlag once; /* atomic one-time initialization flag */
|
||||
int is_kwtuple_owned; /* does this parser own the kwtuple object? */
|
||||
int pos; /* number of positional-only arguments */
|
||||
int min; /* minimal number of arguments */
|
||||
int max; /* maximal number of positional arguments */
|
||||
PyObject *kwtuple; /* tuple of keyword parameter names */
|
||||
struct _PyArg_Parser *next;
|
||||
} _PyArg_Parser;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue