当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessMessage::GetExitStatus方法代码示例

本文整理汇总了C++中ProcessMessage::GetExitStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessMessage::GetExitStatus方法的具体用法?C++ ProcessMessage::GetExitStatus怎么用?C++ ProcessMessage::GetExitStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProcessMessage的用法示例。


在下文中一共展示了ProcessMessage::GetExitStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lock

void
ProcessFreeBSD::SendMessage(const ProcessMessage &message)
{
    Mutex::Locker lock(m_message_mutex);

    switch (message.GetKind())
    {
    case ProcessMessage::eInvalidMessage:
        return;

    case ProcessMessage::eAttachMessage:
        SetPrivateState(eStateStopped);
        return;

    case ProcessMessage::eLimboMessage:
    case ProcessMessage::eExitMessage:
        m_exit_status = message.GetExitStatus();
        SetExitStatus(m_exit_status, NULL);
        break;

    case ProcessMessage::eSignalMessage:
    case ProcessMessage::eSignalDeliveredMessage:
    case ProcessMessage::eBreakpointMessage:
    case ProcessMessage::eTraceMessage:
    case ProcessMessage::eWatchpointMessage:
    case ProcessMessage::eCrashMessage:
        SetPrivateState(eStateStopped);
        break;

    case ProcessMessage::eNewThreadMessage:
        assert(0 && "eNewThreadMessage unexpected on FreeBSD");
        break;

    case ProcessMessage::eExecMessage:
        SetPrivateState(eStateStopped);
        break;
    }

    m_message_queue.push(message);
}
开发者ID:jashank,项目名称:freebsd,代码行数:40,代码来源:ProcessFreeBSD.cpp

示例2: SendMessage

void ProcessFreeBSD::SendMessage(const ProcessMessage &message) {
  std::lock_guard<std::recursive_mutex> guard(m_message_mutex);

  switch (message.GetKind()) {
  case ProcessMessage::eInvalidMessage:
    return;

  case ProcessMessage::eAttachMessage:
    SetPrivateState(eStateStopped);
    return;

  case ProcessMessage::eLimboMessage:
  case ProcessMessage::eExitMessage:
    SetExitStatus(message.GetExitStatus(), NULL);
    break;

  case ProcessMessage::eSignalMessage:
  case ProcessMessage::eSignalDeliveredMessage:
  case ProcessMessage::eBreakpointMessage:
  case ProcessMessage::eTraceMessage:
  case ProcessMessage::eWatchpointMessage:
  case ProcessMessage::eCrashMessage:
    SetPrivateState(eStateStopped);
    break;

  case ProcessMessage::eNewThreadMessage:
    llvm_unreachable("eNewThreadMessage unexpected on FreeBSD");
    break;

  case ProcessMessage::eExecMessage:
    SetPrivateState(eStateStopped);
    break;
  }

  m_message_queue.push(message);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:36,代码来源:ProcessFreeBSD.cpp

示例3: lock

void
ProcessPOSIX::SendMessage(const ProcessMessage &message)
{
    Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));

    Mutex::Locker lock(m_message_mutex);

    Mutex::Locker thread_lock(m_thread_list.GetMutex());

    POSIXThread *thread = static_cast<POSIXThread*>(
        m_thread_list.FindThreadByID(message.GetTID(), false).get());

    switch (message.GetKind())
    {
    case ProcessMessage::eInvalidMessage:
        return;

    case ProcessMessage::eAttachMessage:
        SetPrivateState(eStateStopped);
        return;

    case ProcessMessage::eLimboMessage:
        assert(thread);
        thread->SetState(eStateStopped);
        if (message.GetTID() == GetID())
        {
            m_exit_status = message.GetExitStatus();
            if (m_exit_now)
            {
                SetPrivateState(eStateExited);
                m_monitor->Detach(GetID());
            }
            else
            {
                StopAllThreads(message.GetTID());
                SetPrivateState(eStateStopped);
            }
        }
        else
        {
            StopAllThreads(message.GetTID());
            SetPrivateState(eStateStopped);
        }
        break;

    case ProcessMessage::eExitMessage:
        if (thread != nullptr)
            thread->SetState(eStateExited);
        else
        {
            if (log)
                log->Warning ("ProcessPOSIX::%s eExitMessage for TID %" PRIu64 " failed to find a thread to mark as eStateExited, ignoring", __FUNCTION__, message.GetTID ());
        }

        // FIXME: I'm not sure we need to do this.
        if (message.GetTID() == GetID())
        {
            SetExitStatus(message.GetExitStatus(), NULL);
        }
        else if (!IsAThreadRunning())
            SetPrivateState(eStateStopped);
        break;

    case ProcessMessage::eSignalMessage:
    case ProcessMessage::eSignalDeliveredMessage:
        if (message.GetSignal() == SIGSTOP &&
            AddThreadForInitialStopIfNeeded(message.GetTID()))
            return;
        // Intentional fall-through

    case ProcessMessage::eBreakpointMessage:
    case ProcessMessage::eTraceMessage:
    case ProcessMessage::eWatchpointMessage:
    case ProcessMessage::eCrashMessage:
        assert(thread);
        thread->SetState(eStateStopped);
        StopAllThreads(message.GetTID());
        SetPrivateState(eStateStopped);
        break;

    case ProcessMessage::eNewThreadMessage:
    {
        lldb::tid_t  new_tid = message.GetChildTID();
        if (WaitingForInitialStop(new_tid))
        {
            m_monitor->WaitForInitialTIDStop(new_tid);
        }
        assert(thread);
        thread->SetState(eStateStopped);
        StopAllThreads(message.GetTID());
        SetPrivateState(eStateStopped);
        break;
    }

    case ProcessMessage::eExecMessage:
    {
        assert(thread);
        thread->SetState(eStateStopped);
        StopAllThreads(message.GetTID());
        SetPrivateState(eStateStopped);
//.........这里部分代码省略.........
开发者ID:BlueRiverInteractive,项目名称:lldb,代码行数:101,代码来源:ProcessPOSIX.cpp

示例4: lock

void
ProcessPOSIX::SendMessage(const ProcessMessage &message)
{
    Mutex::Locker lock(m_message_mutex);

    Mutex::Locker thread_lock(m_thread_list.GetMutex());

    POSIXThread *thread = static_cast<POSIXThread*>(
        m_thread_list.FindThreadByID(message.GetTID(), false).get());

    switch (message.GetKind())
    {
    case ProcessMessage::eInvalidMessage:
        return;

    case ProcessMessage::eLimboMessage:
        assert(thread);
        thread->SetState(eStateStopped);
        if (message.GetTID() == GetID())
        {
            m_exit_status = message.GetExitStatus();
            if (m_exit_now)
            {
                SetPrivateState(eStateExited);
                m_monitor->Detach(GetID());
            }
            else
            {
                StopAllThreads(message.GetTID());
                SetPrivateState(eStateStopped);
            }
        }
        else
        {
            StopAllThreads(message.GetTID());
            SetPrivateState(eStateStopped);
        }
        break;

    case ProcessMessage::eExitMessage:
        assert(thread);
        thread->SetState(eStateExited);
        // FIXME: I'm not sure we need to do this.
        if (message.GetTID() == GetID())
        {
            m_exit_status = message.GetExitStatus();
            SetExitStatus(m_exit_status, NULL);
        }
        else if (!IsAThreadRunning())
            SetPrivateState(eStateStopped);
        break;

        assert(thread);
        thread->SetState(eStateStopped);
        StopAllThreads(message.GetTID());
        SetPrivateState(eStateStopped);
        break;

    case ProcessMessage::eSignalMessage:
    case ProcessMessage::eSignalDeliveredMessage:
        if (message.GetSignal() == SIGSTOP &&
            AddThreadForInitialStopIfNeeded(message.GetTID()))
            return;
        // Intentional fall-through

    case ProcessMessage::eBreakpointMessage:
    case ProcessMessage::eTraceMessage:
    case ProcessMessage::eWatchpointMessage:
    case ProcessMessage::eNewThreadMessage:
    case ProcessMessage::eCrashMessage:
        assert(thread);
        thread->SetState(eStateStopped);
        StopAllThreads(message.GetTID());
        SetPrivateState(eStateStopped);
        break;
    }

    m_message_queue.push(message);
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_lldb,代码行数:79,代码来源:ProcessPOSIX.cpp


注:本文中的ProcessMessage::GetExitStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。