ThreadWeaver

weaverinterface.h
1 /* -*- C++ -*-
2  This file declares the WeaverInterface class.
3 
4  SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef WEAVER_INTERFACE_H
10 #define WEAVER_INTERFACE_H
11 
12 #include "jobpointer.h"
13 
14 namespace ThreadWeaver
15 {
16 class Job;
17 class Thread;
18 
19 class THREADWEAVER_EXPORT WeaverInterface
20 {
21 public:
22  virtual ~WeaverInterface()
23  {
24  }
25 
26  /** @brief Assign a job to an idle thread.
27  * @param th the thread to give a new Job to
28  * @param wasBusy true if a job was previously assigned to the calling thread
29  */
30  virtual JobPointer applyForWork(Thread *th, bool wasBusy) = 0;
31 
32  /** @brief Wait (by suspending the calling thread) until a job becomes available. */
33  virtual void waitForAvailableJob(Thread *th) = 0;
34 };
35 
36 }
37 
38 #endif // WEAVER_INTERFACE_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:10:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.