Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:56

0001 //===-- TimeoutResumeAll.h -------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_TIMEOUTRESUMEALL_H
0010 #define LLDB_TARGET_TIMEOUTRESUMEALL_H
0011 
0012 #include "lldb/Target/ThreadPlanSingleThreadTimeout.h"
0013 
0014 namespace lldb_private {
0015 
0016 // Mixin class that provides the capability for ThreadPlan to support single
0017 // thread execution that resumes all threads after a timeout.
0018 // Opt-in thread plan should call PushNewTimeout() in its DidPush() and
0019 // ResumeWithTimeout() during DoWillResume().
0020 class TimeoutResumeAll {
0021 public:
0022   TimeoutResumeAll(Thread &thread)
0023       : m_thread(thread),
0024         m_timeout_info(
0025             std::make_shared<ThreadPlanSingleThreadTimeout::TimeoutInfo>()) {}
0026 
0027   void PushNewTimeout() {
0028     ThreadPlanSingleThreadTimeout::PushNewWithTimeout(m_thread, m_timeout_info);
0029   }
0030 
0031   void ResumeWithTimeout() {
0032     ThreadPlanSingleThreadTimeout::ResumeFromPrevState(m_thread,
0033                                                        m_timeout_info);
0034   }
0035 
0036 private:
0037   Thread &m_thread;
0038   ThreadPlanSingleThreadTimeout::TimeoutInfoSP m_timeout_info;
0039 };
0040 
0041 } // namespace lldb_private
0042 
0043 #endif // LLDB_TARGET_TIMEOUTRESUMEALL_H