10000 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
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
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 10000
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
Prev Previous commit
Next Next commit
Fix formatting.
  • Loading branch information
ericsnowcurrently committed Dec 12, 2022
commit d4f05e41d2fdcb326c004cc88b0255c801df1c0c
18 changes: 8 additions & 10 deletions Include/internal/pycore_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

#include "pycore_atomic.h" // _Py_atomic_address
#include "pycore_atomic.h" // _Py_atomic_address

#ifdef MS_WINDOWS
# include <windows.h> // HANDLE
# include <winsock2.h> // SOCKET
#endif
#ifdef HAVE_SIGNAL_H
# include <signal.h> // NSIG
# include <windows.h> // HANDLE
# include <winsock2.h> // SOCKET
#endif
#include <signal.h> // NSIG


#ifdef _SIG_MAXSIG
Expand All @@ -29,13 +27,13 @@ extern "C" {
#elif defined(NSIG)
# define Py_NSIG NSIG
#elif defined(_NSIG)
# define Py_NSIG _NSIG // BSD/SysV
# define Py_NSIG _NSIG // BSD/SysV
#elif defined(_SIGMAX)
# define Py_NSIG (_SIGMAX + 1) // QNX
# define Py_NSIG (_SIGMAX + 1) // QNX
#elif defined(SIGMAX)
# define Py_NSIG (SIGMAX + 1) // djgpp
# define Py_NSIG (SIGMAX + 1) // djgpp
#else
# define Py_NSIG 64 // Use a reasonable default value
# define Py_NSIG 64 // Use a reasonable default value
#endif

#ifdef MS_WINDOWS
Expand Down
0