void SimplyControllable::suspendIfSuspendWallEnabled(void)
{
    m_suspendWall_mutex.lock();
    while(m_suspendWall_enabled) {
        setSuspended(true);
        m_suspendWall_waitCondition.wait(&m_suspendWall_mutex); // Will block until the mutex is unlocked (i.e. the thread is resumed).
        setSuspended(false);
    }
    m_suspendWall_mutex.unlock();
}
Exemple #2
0
ScopedPageSuspender::ScopedPageSuspender() {
  if (++s_suspensionCount > 1)
    return;

  setSuspended(true);
  Platform::current()->currentThread()->scheduler()->suspendTimerQueue();
}
Exemple #3
0
ScopedPageSuspender::~ScopedPageSuspender() {
  if (--s_suspensionCount > 0)
    return;

  setSuspended(false);
  Platform::current()->currentThread()->scheduler()->resumeTimerQueue();
}
JobView::JobView(QObject* parent)
    : Plasma::DataContainer(parent),
      m_capabilities(-1),
      m_percent(0),
      m_speed(0),
      m_totalBytes(0),
      m_processedBytes(0),
      m_state(UnknownState),
      m_bytesUnitId(-1),
      m_unitId(0)
{
    m_jobId = ++s_jobId;
    setObjectName(QString("Job %1").arg(s_jobId));

    new JobViewV2Adaptor(this);

    m_objectPath.setPath(QString("/DataEngine/applicationjobs/JobView_%1").arg(m_jobId));
    QDBusConnection::sessionBus().registerObject(m_objectPath.path(), this);

    setSuspended(false);
}