AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
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
AJAThreadImpl::mThreadID
DWORD mThreadID
Definition: threadimpl.h:44
AJAThreadImpl::IsCurrentThread
bool IsCurrentThread()
Definition: threadimpl.cpp:406
HANDLE
short HANDLE
Definition: ajatypes.h:304
AJAThreadImpl::mPriority
AJAThreadPriority mPriority
Definition: threadimpl.h:49
AJAThreadImpl::mpUserContext
void * mpUserContext
Definition: threadimpl.h:51
AJAThreadImpl::GetThreadId
static uint64_t GetThreadId()
Definition: threadimpl.cpp:685
AJAThreadImpl::SetThreadName
AJAStatus SetThreadName(const char *name)
Definition: threadimpl.cpp:672
AJAThreadImpl::mpThread
AJAThread * mpThread
Definition: threadimpl.h:42
AJAThreadImpl::mThreadFunc
AJAThreadFunction * mThreadFunc
Definition: threadimpl.h:50
AJAThreadImpl::~AJAThreadImpl
virtual ~AJAThreadImpl()
Definition: threadimpl.cpp:84
AJAThreadPriority
AJAThreadPriority
Definition: thread.h:39
AJAThreadImpl
Definition: threadimpl.h:18
AJAThread
Definition: thread.h:69
AJAThreadImpl::mLock
AJALock mLock
Definition: threadimpl.h:52
AJAStatus
AJAStatus
Definition: types.h:365
AJAThreadImpl::Kill
AJAStatus Kill(uint32_t exitCode)
Definition: threadimpl.cpp:332
lock.h
Declares the AJALock class.
AJAThreadImpl::Active
bool Active()
Definition: threadimpl.cpp:386
AJALock
Definition: lock.h:30
system.h
System specific functions.
AJAThreadImpl::mTerminate
bool mTerminate
Definition: threadimpl.h:58
common.h
Private include file for all ajabase sources.
AJAThreadImpl::mhThreadHandle
HANDLE mhThreadHandle
Definition: threadimpl.h:43
AJAThreadRealTimePolicy
AJAThreadRealTimePolicy
Definition: thread.h:50
AJAThreadImpl::ThreadProcStatic
static void * ThreadProcStatic(void *pThreadImplContext)
Definition: threadimpl.cpp:581
AJAThreadImpl::AJAThreadImpl
AJAThreadImpl(AJAThread *pThreadContext)
Definition: threadimpl.cpp:45
AJAThreadImpl::Stop
AJAStatus Stop(uint32_t timeout=0xffffffff)
Definition: threadimpl.cpp:208
AJAThreadImpl::Start
AJAStatus Start()
Definition: threadimpl.cpp:116
AJAThreadImpl::SetPriority
AJAStatus SetPriority(AJAThreadPriority threadPriority)
Definition: threadimpl.cpp:425
AJAThreadImpl::Attach
AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
Definition: threadimpl.cpp:566
thread.h
Declares the AJAThread class.
AJAThreadImpl::GetPriority
AJAStatus GetPriority(AJAThreadPriority *pThreadPriority)
Definition: threadimpl.cpp:504
AJAThreadImpl::SetRealTime
AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority)
Definition: threadimpl.cpp:522