8000 gh-81057: Move Signal-Related Globals to _PyRuntimeState by ericsnowcurrently · Pull Request #100085 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-81057: Move Signal-Related Globals to _PyRuntimeState #100085

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6dcffac
Add struct _signals_runtime_state.
ericsnowcurrently Dec 6, 2022
5e49464
Move signalmodule.c:Handlers to _PyRuntimeState.
ericsnowcurrently Dec 6, 2022
07332af
Move signalmodule.c:wakeup to _PyRuntimeState.
ericsnowcurrently Dec 6, 2022
1b5ec60
Move signalmodule.c:is_tripped to _PyRuntimeState.
ericsnowcurrently Dec 6, 2022
280f6f4
Move signalmodule.c:signal_global_state to _PyRuntimeState.
ericsnowcurrently Dec 7, 2022
fd6a2de
Fix includes (e.g. for Windows) in pycore_signal.h.
ericsnowcurrently Dec 8, 2022
410190b
Drop the socketmodule.h include.
ericsnowcurrently Dec 8, 2022
1fc3dce
Fix the include for SOCKET on Windows.
ericsnowcurrently Dec 8, 2022
d4f05e4
Fix formatting.
ericsnowcurrently Dec 8, 2022
1ddece1
Fix order of includes on WINDOWS.
ericsnowcurrently Dec 8, 2022
9592a8b
Fix includes on Windows.
ericsnowcurrently Dec 9, 2022
cc43787
Fix INVALID_FD on Windows.
ericsnowcurrently Dec 9, 2022
0164014
Revert "Fix includes on Windows."
ericsnowcurrently Dec 9, 2022
1d8d9e2
Include the headers conditionally.
ericsnowcurrently Dec 9, 2022
555f727
Fail instead of falling back to includes.
ericsnowcurrently Dec 9, 2022
57dc4a8
Reach for a sweet spot.
ericsnowcurrently Dec 10, 2022
08799ad
Pull in HANDLE.
ericsnowcurrently Dec 10, 2022
8000
3bad4d6
Drop an unnecessary ifdef.
ericsnowcurrently Dec 12, 2022
3624161
Force the ifdef checks for the actual definition of _PyRuntime.
ericsnowcurrently Dec 12, 2022
2191c97
Drop the ifdef checks.
ericsnowcurrently Dec 12, 2022
76794fb
Change members/macros to fail (or warn) when used without the proper …
ericsnowcurrently Dec 12, 2022
c9aee62
Make sure the Windows includes happen early enough.
ericsnowcurrently Dec 12, 2022
ca33ad7
Move the includes up.
ericsnowcurrently Dec 12, 2022
7f35360
Check for _WINSOCKAPI_ instead of SOCKET.
ericsnowcurrently Dec 12, 2022
3d23778
Define a HANDLE macro where needed.
ericsnowcurrently Dec 12, 2022
73e3bc1
Use void* for the "fd" field.
ericsnowcurrently Dec 12, 2022
4195e62
Use void* for the "sigint_event" field.
ericsnowcurrently Dec 12, 2022
36cda7b
Use an int for wakeup.fd, instead of SOCKET.
ericsnowcurrently Dec 12, 2022
2a3bdf1
Drop the explicit includes.
ericsnowcurrently Dec 12, 2022
38596a0
Fix a warning.
ericsnowcurrently Dec 12, 2022
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
Next Next commit
Add struct _signals_runtime_state.
  • Loading branch information
ericsnowcurrently committed Dec 12, 2022
commit 6dcffacfdbe20e54153824770f6d2389dd8793a9
7 changes: 2 additions & 5 deletions Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {
#include "pycore_pyhash.h" // struct pyhash_runtime_state
#include "pycore_pythread.h" // struct _pythread_runtime_state
#include "pycore_obmalloc.h" // struct obmalloc_state
#include "pycore_signal.h" // struct _signals_runtime_state
#include "pycore_time.h" // struct _time_runtime_state
#include "pycore_tracemalloc.h" // struct _tracemalloc_runtime_state
#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids
Expand Down Expand Up @@ -93,13 +94,9 @@ typedef struct pyruntimestate {
struct _pymem_allocators allocators;
struct _obmalloc_state obmalloc;
struct pyhash_runtime_state pyhash_state;
struct {
/* True if the main interpreter thread exited due to an unhandled
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
int unhandled_keyboard_interrupt;
} signals;
struct _time_runtime_state time;
struct _pythread_runtime_state threads;
struct _signals_runtime_state signals;

struct pyinterpreters {
PyThread_type_lock mutex;
Expand Down
8 changes: 8 additions & 0 deletions Include/internal/pycore_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ extern "C" {
# define Py_NSIG 64 // Use a reasonable default value
#endif


struct _signals_runtime_state {
/* True if the main interpreter thread exited due to an unhandled
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
int unhandled_keyboard_interrupt;
};


#ifdef __cplusplus
}
#endif
Expand Down
0