/* Multi-process/thread control defs for GDB, the GNU debugger.
- Copyright (C) 1987-2018 Free Software Foundation, Inc.
+ Copyright (C) 1987-2019 Free Software Foundation, Inc.
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
#include "target/waitstatus.h"
#include "cli/cli-utils.h"
#include "common/refcounted-object.h"
-#include "common-gdbthread.h"
+#include "common/common-gdbthread.h"
+#include "common/forward-scope-exit.h"
struct inferior;
/* Calls finish_thread_state on scope exit, unless release() is called
to disengage. */
-class scoped_finish_thread_state
-{
-public:
- explicit scoped_finish_thread_state (ptid_t ptid)
- : m_ptid (ptid)
- {}
-
- ~scoped_finish_thread_state ()
- {
- if (!m_released)
- finish_thread_state (m_ptid);
- }
-
- /* Disengage. */
- void release ()
- {
- m_released = true;
- }
-
- DISABLE_COPY_AND_ASSIGN (scoped_finish_thread_state);
-
-private:
- bool m_released = false;
- ptid_t m_ptid;
-};
+using scoped_finish_thread_state
+ = FORWARD_SCOPE_EXIT (finish_thread_state);
/* Commands with a prefix of `thread'. */
extern struct cmd_list_element *thread_cmd_list;