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 <tom@tromey.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user