FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-114271: Clean Up _threadmodule.c by ericsnowcurrently · Pull Request #116776 · python/cpython · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (3) .filters  (1) .h  (1) .in  (1) .vcxproj  (1) All 5 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
27 changes: 26 additions & 1 deletion Include/internal/pycore_pythread.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL