8#include <cx/taskqueue/worker/tqthreadworker.h>
12typedef struct TaskQueue TaskQueue;
13typedef struct TaskQueue_WeakRef TaskQueue_WeakRef;
14typedef struct TaskQueue TaskQueue;
15typedef struct TaskQueue_WeakRef TaskQueue_WeakRef;
16typedef struct TQThreadPoolRunner TQThreadPoolRunner;
17typedef struct TQThreadPoolRunner_WeakRef TQThreadPoolRunner_WeakRef;
18typedef struct TQThreadPoolManager TQThreadPoolManager;
19typedef struct TQThreadPoolManager_WeakRef TQThreadPoolManager_WeakRef;
22#define _sti_TQThreadPoolManager _sti_object
23#define SType_TQThreadPoolManager TQThreadPoolManager*
24#define STStorageType_TQThreadPoolManager TQThreadPoolManager*
25#define STypeArg_TQThreadPoolManager(type, val) stgeneric(object, (ObjInst*)objInstCheckClass(TQThreadPoolManager, val))
26#define STypeArgPtr_TQThreadPoolManager(type, val) (stgeneric*)objInstCheckClassPtr(TQThreadPoolManager, val)
27#define STypeCheckedArg_TQThreadPoolManager(type, val) stType(type), stArg(type, val)
28#define STypeCheckedPtrArg_TQThreadPoolManager(type, val) stType(type), stArgPtr(type, val)
30typedef struct TQThreadPoolManager_ClassIf {
35 bool (*start)(_In_
void* self, _In_ TaskQueue* tq);
36 bool (*stop)(_In_
void* self);
37 void (*notify)(_In_
void* self,
bool wakeup);
39 void (*pretask)(_In_
void* self);
40 int64 (*tick)(_In_
void* self);
41 void (*updatePoolSize)(_In_
void* self);
42} TQThreadPoolManager_ClassIf;
43extern TQThreadPoolManager_ClassIf TQThreadPoolManager_ClassIf_tmpl;
45typedef struct TQThreadPoolManager {
47 TQThreadPoolManager_ClassIf* _;
48 void* _is_TQThreadPoolManager;
58 TQThreadPoolRunner* runner;
64#define TQThreadPoolManager(inst) objInstCheckClass(TQThreadPoolManager, inst)
65#define TQThreadPoolManagerNone ((TQThreadPoolManager*)NULL)
67typedef struct TQThreadPoolManager_WeakRef {
70 void* _is_TQThreadPoolManager_WeakRef;
71 void* _is_TQManager_WeakRef;
72 void* _is_ObjInst_WeakRef;
76} TQThreadPoolManager_WeakRef;
77#define TQThreadPoolManager_WeakRef(inst) objWeakRefCheckClass(TQThreadPoolManager, inst)
80#define tqthreadpoolmanagerStart(self, tq) (self)->_->start(TQThreadPoolManager(self), TaskQueue(tq))
82#define tqthreadpoolmanagerStop(self) (self)->_->stop(TQThreadPoolManager(self))
84#define tqthreadpoolmanagerNotify(self, wakeup) (self)->_->notify(TQThreadPoolManager(self), wakeup)
88#define tqthreadpoolmanagerPretask(self) (self)->_->pretask(TQThreadPoolManager(self))
90#define tqthreadpoolmanagerTick(self) (self)->_->tick(TQThreadPoolManager(self))
92#define tqthreadpoolmanagerUpdatePoolSize(self) (self)->_->updatePoolSize(TQThreadPoolManager(self))
#define saDeclarePtr(name)
CX Struct System - Introspectable, serializable POD structures in C.
CX Object System - Object-oriented programming in C.