AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
thread.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJA_THREAD_H
9 #define AJA_THREAD_H
10 
11 #include "ajabase/common/public.h"
12 
13 // forward declarations
14 class AJAThread;
15 class AJAThreadImpl;
16 
17 
22 typedef void AJAThreadFunction(AJAThread* pThread, void* pContext);
23 
29 {
33 };
34 
35 
40 {
47 };
48 
49 
51 {
54 };
55 
56 
70 {
71 public:
72 
73  AJAThread();
74  virtual ~AJAThread();
75 
83  virtual AJAStatus Start();
84 
94  virtual AJAStatus Stop(uint32_t timeout = 0xffffffff);
95 
102  virtual AJAStatus Kill(uint32_t exitCode);
103 
110  virtual bool Active();
111 
118  virtual bool IsCurrentThread();
119 
128  virtual AJAStatus SetPriority(AJAThreadPriority priority);
129 
136  virtual AJAStatus GetPriority(AJAThreadPriority* pPriority);
137 
147  virtual AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority);
148 
159  virtual AJAStatus ThreadRun();
160 
169  virtual AJAStatus ThreadInit();
170 
179  virtual bool ThreadLoop();
180 
189  virtual AJAStatus ThreadFlush();
190 
199  virtual bool Terminate();
200 
211  virtual AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext);
212 
221  virtual AJAStatus SetThreadName(const char *name);
222 
228  static uint64_t GetThreadId();
229 
230 private:
231 
232  AJAThreadImpl* mpImpl;
233 };
234 
235 #endif // AJA_THREAD_H
AJA_ThreadPriority_High
@ AJA_ThreadPriority_High
Definition: thread.h:44
AJA_ThreadState_Shutdown
@ AJA_ThreadState_Shutdown
Definition: thread.h:32
AJA_ThreadState_Running
@ AJA_ThreadState_Running
Definition: thread.h:30
AJA_EXPORT
#define AJA_EXPORT
Definition: export.h:34
AJAThreadPriority
AJAThreadPriority
Definition: thread.h:39
public.h
Master header for the ajabase library.
AJAThreadImpl
Definition: threadimpl.h:18
AJA_ThreadPriority_TimeCritical
@ AJA_ThreadPriority_TimeCritical
Definition: thread.h:45
AJA_ThreadRealTimePolicyFIFO
@ AJA_ThreadRealTimePolicyFIFO
Definition: thread.h:52
AJAThread
Definition: thread.h:69
AJA_ThreadRealTimePolicyRoundRobin
@ AJA_ThreadRealTimePolicyRoundRobin
Definition: thread.h:53
AJAStatus
AJAStatus
Definition: types.h:378
AJA_ThreadPriority_Unknown
@ AJA_ThreadPriority_Unknown
Definition: thread.h:41
AJA_ThreadPriority_Normal
@ AJA_ThreadPriority_Normal
Definition: thread.h:43
AJA_ThreadPriority_AboveNormal
@ AJA_ThreadPriority_AboveNormal
Definition: thread.h:46
AJAThreadRealTimePolicy
AJAThreadRealTimePolicy
Definition: thread.h:50
AJA_ThreadPriority_Low
@ AJA_ThreadPriority_Low
Definition: thread.h:42
AJA_ThreadState_Idle
@ AJA_ThreadState_Idle
Definition: thread.h:31
AJAThread::AJAThreadFunction
void AJAThreadFunction(AJAThread *pThread, void *pContext)
Definition: thread.h:22
AJAThreadState
AJAThreadState
Definition: thread.h:28