File indexing completed on 2024-05-05 08:04:31
0001 /* -*- C++ -*- 0002 This file implements the ShuttingDownState 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: ShuttingDownState.cpp 30 2005-08-16 16:16:04Z mirko $ 0009 */ 0010 0011 #include "shuttingdownstate.h" 0012 0013 namespace ThreadWeaver 0014 { 0015 ShuttingDownState::ShuttingDownState(QueueSignals *weaver) 0016 : WeaverImplState(weaver) 0017 { 0018 } 0019 0020 void ShuttingDownState::shutDown() 0021 { 0022 } 0023 0024 void ShuttingDownState::suspend() 0025 { 0026 // ignored: when shutting down, we do not return to the suspended state 0027 } 0028 0029 void ShuttingDownState::resume() 0030 { 0031 // ignored: when shutting down, we do not return from the suspended state 0032 } 0033 0034 JobPointer ShuttingDownState::applyForWork(Thread *, bool wasBusy) 0035 { 0036 Q_UNUSED(wasBusy) // except in Q_ASSERT 0037 Q_ASSERT(wasBusy == false); 0038 return JobPointer(); // tell threads to exit 0039 } 0040 0041 void ShuttingDownState::waitForAvailableJob(Thread *) 0042 { 0043 // immediately return here 0044 } 0045 0046 StateId ShuttingDownState::stateId() const 0047 { 0048 return ShuttingDown; 0049 } 0050 0051 }