Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add PyThread__init_thread():lib_initialized.
  • Loading branch information
ericsnowcurrently committed Dec 9, 2022
commit 96161232d83da1eeafd9a61a527232b64a2721c3
10 changes: 8 additions & 2 deletions Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,16 @@ typedef struct {
static void
PyThread__init_thread(void)
{
// The library is only initialized once in the process,
// regardless of how many times the Python runtime is initialized.
static int lib_initialized = 0;
if (!lib_initialized) {
lib_initialized = 1;
#if defined(_AIX) && defined(__GNUC__)
extern void pthread_init(void);
pthread_init();
extern void pthread_init(void);
pthread_init();
#endif
}
init_condattr();
}

Expand Down
5 changes: 3 additions & 2 deletions Tools/c-analyzer/cpython/ignored.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Python/fileutils.c set_inheritable ioctl_works -
# XXX Is this thread-safe?
Modules/posixmodule.c os_dup2_impl dup3_works -

## resource init - set during first init
## guards around resource init
Python/thread.c - initialized -
Python/thread_pthread.h PyThread__init_thread lib_initialized -
Python/thread_pthread.h - condattr_monotonic -
# safe static buffer used during one-time initialization
# static buffer used during one-time initialization
Python/thread_pthread.h init_condattr ca -

##-----------------------
Expand Down