ThreadWeaver

weaverinterface.h
1/* -*- C++ -*-
2 This file declares the WeaverInterface class.
3
4 SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <mirko@kde.org>
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
14namespace ThreadWeaver
15{
16class Job;
17class Thread;
18
19class THREADWEAVER_EXPORT WeaverInterface
20{
21public:
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-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:40:09 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.