示例#1
0
文件: Thread.hpp 项目: el-bart/TIER
 inline void stop(void)
 {
   if( !isRunning() )              // multiple 'stops' allowed
     return;
   cancelThread();
   waitForFinish();
 };
UIComplexModServiceTask::~UIComplexModServiceTask()
{
	waitForFinish();

	if (m_pIPCCL)
	{
		m_pIPCCL->onCompleteEvent -= delegate(this, &UIComplexModServiceTask::onComplete);
		m_pIPCCL->onProgressEvent -= delegate(this, &UIComplexModServiceTask::onProgress);
		m_pIPCCL->onErrorEvent -= delegate((UIBaseServiceTask*)this, &UIBaseServiceTask::onServiceError);

		m_pIPCCL->destroy();
		m_pIPCCL = nullptr;
	}
}
UIUpdateServiceTask::~UIUpdateServiceTask()
{
	waitForFinish();

	if (m_pIPCIM)
	{
		m_pIPCIM->onCompleteEvent -= delegate(this, &UIUpdateServiceTask::onComplete);
		m_pIPCIM->onProgressEvent -= delegate(&onMcfProgressEvent);
		m_pIPCIM->onErrorEvent -= delegate((UIBaseServiceTask*)this, &UIBaseServiceTask::onServiceError);

		m_pIPCIM->destroy();
		m_pIPCIM = nullptr;
	}
}
示例#4
0
QJsonArray
libertined_list_app_ids(char const* container_id)
{
  SessionBus session;
  auto path = call(session.bus, "list_app_ids", QVariantList{QVariant(container_id)});

  if (!waitForFinish(session.bus, path))
  {
    return QJsonArray();
  }

  auto error = lastError(session.bus, path);
  if (!error.isEmpty())
  {
    qWarning() << "error:" << error;
    return QJsonArray();
  }

  return QJsonDocument::fromJson(result(session.bus, path).toLatin1()).array();
}