File indexing completed on 2024-04-28 04:01:24
0001 /* -*- C++ -*- 0002 This file declares the SuspendedState class. 0003 0004 SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <mirko@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 0008 $Id: SuspendedState.h 32 2005-08-17 08:38:01Z mirko $ 0009 */ 0010 0011 #ifndef SuspendedState_H 0012 #define SuspendedState_H 0013 0014 #include "weaver.h" 0015 #include "weaverimplstate.h" 0016 0017 namespace ThreadWeaver 0018 { 0019 /** In SuspendedState, jobs are queued, but will not be executed. All 0020 * thread remains blocked. */ 0021 class SuspendedState : public WeaverImplState 0022 { 0023 public: 0024 explicit SuspendedState(Weaver *weaver); 0025 /** Suspend job processing. */ 0026 void suspend() override; 0027 /** Resume job processing. */ 0028 void resume() override; 0029 /** Assign a job to an idle thread. */ 0030 JobPointer applyForWork(Thread *th, bool wasBusy) override; 0031 /** reimpl */ 0032 StateId stateId() const override; 0033 }; 0034 0035 } 0036 0037 #endif // SuspendedState_H