bin/pc: Mark non-returning function as void
[haiku.git] / src / servers / launch / Worker.h
blob0b2aa52d021d1cae7bdb15d81e742d9cbc7dbe71
1 /*
2 * Copyright 2015, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef WORKER_H
6 #define WORKER_H
9 #include <Job.h>
10 #include <JobQueue.h>
13 using namespace BSupportKit;
14 using BSupportKit::BPrivate::JobQueue;
17 class Worker {
18 public:
19 Worker(JobQueue& queue);
20 virtual ~Worker();
22 status_t Init();
24 protected:
25 virtual status_t Process();
26 virtual bigtime_t Timeout() const;
27 virtual const char* Name() const;
28 virtual status_t Run(BJob* job);
30 private:
31 static status_t _Process(void* self);
33 protected:
34 thread_id fThread;
35 JobQueue& fJobQueue;
39 class MainWorker : public Worker {
40 public:
41 MainWorker(JobQueue& queue);
43 protected:
44 virtual bigtime_t Timeout() const;
45 virtual const char* Name() const;
46 virtual status_t Run(BJob* job);
48 private:
49 int32 fMaxWorkerCount;
53 #endif // WORKER_H