AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
threadimpl.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJA_THREAD_IMPL_H
9 #define AJA_THREAD_IMPL_H
10 
11 #include "ajabase/system/system.h"
12 #include "ajabase/common/common.h"
13 #include "ajabase/system/thread.h"
14 #include "ajabase/system/lock.h"
15 
16 
17 class AJAThreadImpl
18 {
19 public:
20 
21  AJAThreadImpl(AJAThread* pThread);
22  virtual ~AJAThreadImpl();
23 
24  AJAStatus Start();
25  AJAStatus Stop(uint32_t timeout = 0xffffffff);
26  AJAStatus Kill(uint32_t exitCode);
27 
28  bool Active();
29  bool IsCurrentThread();
30 
31  AJAStatus SetPriority(AJAThreadPriority threadPriority);
32  AJAStatus GetPriority(AJAThreadPriority* pThreadPriority);
33 
34  AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority);
35 
36  AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext);
37  AJAStatus SetThreadName(const char *name);
38 
39  static uint64_t GetThreadId();
40  static DWORD WINAPI ThreadProcStatic(void* pThreadImplContext);
41 
44  DWORD mThreadID;
46  AJAThreadFunction* mThreadFunc;
47  void* mpUserContext;
48  AJALock mLock;
49  bool mTerminate;
50 };
51 
52 #endif // AJA_THREAD_IMPL_H
Declares the AJALock class.
void * mpUserContext
Definition: threadimpl.h:51
AJAStatus Start()
Definition: threadimpl.cpp:116
AJAThreadPriority
Definition: thread.h:39
AJAStatus
Definition: types.h:380
bool mTerminate
Definition: threadimpl.h:58
static uint64_t GetThreadId()
Definition: threadimpl.cpp:685
DWORD mThreadID
Definition: threadimpl.h:44
Definition: lock.h:28
short HANDLE
Definition: ajatypes.h:285
AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
Definition: threadimpl.cpp:566
bool IsCurrentThread()
Definition: threadimpl.cpp:406
AJAThreadPriority mPriority
Definition: threadimpl.h:49
AJAThreadRealTimePolicy
Definition: thread.h:50
Declares the AJAThread class.
virtual ~AJAThreadImpl()
Definition: threadimpl.cpp:84
AJAThread * mpThread
Definition: threadimpl.h:42
AJALock mLock
Definition: threadimpl.h:52
AJAThreadFunction * mThreadFunc
Definition: threadimpl.h:50
AJAThreadImpl(AJAThread *pThreadContext)
Definition: threadimpl.cpp:45
AJAStatus GetPriority(AJAThreadPriority *pThreadPriority)
Definition: threadimpl.cpp:504
HANDLE mhThreadHandle
Definition: threadimpl.h:43
System specific functions.
Private include file for all ajabase sources.
AJAStatus SetPriority(AJAThreadPriority threadPriority)
Definition: threadimpl.cpp:425
AJAStatus Kill(uint32_t exitCode)
Definition: threadimpl.cpp:332
static void * ThreadProcStatic(void *pThreadImplContext)
Definition: threadimpl.cpp:581
AJAStatus SetThreadName(const char *name)
Definition: threadimpl.cpp:672
AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority)
Definition: threadimpl.cpp:522
AJAStatus Stop(uint32_t timeout=0xffffffff)
Definition: threadimpl.cpp:208