Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-114271: Clean Up _threadmodule.c #116776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 26 additions & 1 deletion Include/internal/pycore_pythread.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct _pythread_runtime_state {
} stubs;
#endif

// Linked list of ThreadHandleObjects
// Linked list of struct _PyThread_handle_data
struct llist_node handles;
};

Expand Down Expand Up @@ -153,6 +153,31 @@ PyAPI_FUNC(int) PyThread_join_thread(PyThread_handle_t);
*/
PyAPI_FUNC(int) PyThread_detach_thread(PyThread_handle_t);


/******************/
/* thread handles */
/******************/

// Handles transition from RUNNING to one of JOINED, DETACHED, or INVALID (post
// fork).
typedef enum {
THREAD_HANDLE_RUNNING = 1,
THREAD_HANDLE_JOINED = 2,
THREAD_HANDLE_DETACHED = 3,
THREAD_HANDLE_INVALID = 4,
} _PyThreadHandleState;

extern PyTypeObject _PyThreadHandle_Type;

extern PyObject * _PyThreadHandle_NewObject(void);
extern _PyEventRc * _PyThreadHandle_GetExitingEvent(PyObject *);
extern void _PyThreadHandle_SetStarted(
PyObject *obj,
PyThread_handle_t handle,
PyThread_ident_t ident
);


#ifdef __cplusplus
}
#endif
Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ OBJECT_OBJS= \
Objects/setobject.o \
Objects/sliceobject.o \
Objects/structseq.o \
Objects/threadhandleobject.o \
Objects/tupleobject.o \
Objects/typeobject.o \
Objects/typevarobject.o \
Expand Down
Loading