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 | |
14 | namespace ThreadWeaver |
15 | { |
16 | class Job; |
17 | class Thread; |
18 | |
19 | /*! |
20 | * \class ThreadWeaver::WeaverInterface |
21 | * \inheaderfile ThreadWeaver/WeaverInterface |
22 | * \inmodule ThreadWeaver |
23 | */ |
24 | class THREADWEAVER_EXPORT WeaverInterface |
25 | { |
26 | public: |
27 | /*! |
28 | */ |
29 | virtual ~WeaverInterface() |
30 | { |
31 | } |
32 | |
33 | /*! |
34 | * \brief Assign a job to an idle thread. |
35 | * |
36 | * \a th the thread to give a new Job to |
37 | * |
38 | * \a wasBusy true if a job was previously assigned to the calling thread |
39 | */ |
40 | virtual JobPointer applyForWork(Thread *th, bool wasBusy) = 0; |
41 | |
42 | /*! \brief Wait (by suspending the calling thread) until a job becomes available. */ |
43 | virtual void waitForAvailableJob(Thread *th) = 0; |
44 | }; |
45 | |
46 | } |
47 | |
48 | #endif // WEAVER_INTERFACE_H |
49 | |