CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
tqmonitor.h
1#pragma once
2// This header file is auto-generated!
3// Do not make changes to this file or they will be overwritten.
4// clang-format off
5#include <cx/obj.h>
7
8typedef struct TaskQueue TaskQueue;
9typedef struct TaskQueue_WeakRef TaskQueue_WeakRef;
10typedef struct TQMonitor TQMonitor;
11typedef struct TQMonitor_WeakRef TQMonitor_WeakRef;
12saDeclarePtr(TQMonitor);
13saDeclarePtr(TQMonitor_WeakRef);
14
15typedef struct TQMonitor_ClassIf {
16 ObjIface* _implements;
17 ObjIface* _parent;
18 size_t _size;
19
20 bool (*start)(_In_ void* self, _In_ TaskQueue* tq);
21 int64 (*tick)(_In_ void* self);
22 bool (*stop)(_In_ void* self);
23} TQMonitor_ClassIf;
24extern TQMonitor_ClassIf TQMonitor_ClassIf_tmpl;
25
26typedef struct TQMonitor {
27 union {
28 TQMonitor_ClassIf* _;
29 void* _is_TQMonitor;
30 void* _is_ObjInst;
31 };
32 ObjClassInfo* _clsinfo;
33 atomic(uintptr) _ref;
34 atomic(ptr) _weakref;
35
36 TaskQueue* tq;
38} TQMonitor;
39extern ObjClassInfo TQMonitor_clsinfo;
40#define TQMonitor(inst) ((TQMonitor*)(unused_noeval((inst) && &((inst)->_is_TQMonitor)), (inst)))
41#define TQMonitorNone ((TQMonitor*)NULL)
42
43typedef struct TQMonitor_WeakRef {
44 union {
45 ObjInst* _inst;
46 void* _is_TQMonitor_WeakRef;
47 void* _is_ObjInst_WeakRef;
48 };
49 atomic(uintptr) _ref;
50 RWLock _lock;
51} TQMonitor_WeakRef;
52#define TQMonitor_WeakRef(inst) ((TQMonitor_WeakRef*)(unused_noeval((inst) && &((inst)->_is_TQMonitor_WeakRef)), (inst)))
53
54// bool tqmonitorStart(TQMonitor* self, TaskQueue* tq);
55#define tqmonitorStart(self, tq) (self)->_->start(TQMonitor(self), TaskQueue(tq))
56// int64 tqmonitorTick(TQMonitor* self);
57#define tqmonitorTick(self) (self)->_->tick(TQMonitor(self))
58// bool tqmonitorStop(TQMonitor* self);
59#define tqmonitorStop(self) (self)->_->stop(TQMonitor(self))
60
#define saDeclarePtr(name)
Definition sarray.h:98
CX Object System - Object-oriented programming in C.
Queue monitoring configuration for detecting stalled tasks.
Shared types and configuration structures for the task queue system.