From 7ae9ecfd80104a793ed1d836fd4dc0aa1a9c7832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= Date: Wed, 6 Dec 2023 17:17:25 +0100 Subject: gdb: move gdbpy_gil into python-internal.h Move gdbpy_gil class into python-internal.h, the next commit wants to make use of this class from a file other than python.c. Approved-By: Tom Tromey --- gdb/python/python.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 832f374..2ca3c50 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -264,30 +264,6 @@ gdbpy_enter::finalize () python_gdbarch = current_inferior ()->arch (); } -/* A helper class to save and restore the GIL, but without touching - the other globals that are handled by gdbpy_enter. */ - -class gdbpy_gil -{ -public: - - gdbpy_gil () - : m_state (PyGILState_Ensure ()) - { - } - - ~gdbpy_gil () - { - PyGILState_Release (m_state); - } - - DISABLE_COPY_AND_ASSIGN (gdbpy_gil); - -private: - - PyGILState_STATE m_state; -}; - /* Set the quit flag. */ static void -- cgit v1.1