DJI Onboard SDK  4.0
posix_thread_manager.hpp
Go to the documentation of this file.
1 
30 #ifndef POSIXTHREADMANAGER_H
31 #define POSIXTHREADMANAGER_H
32 
33 #include "dji_thread_manager.hpp"
34 #include "pthread.h"
35 
36 namespace DJI
37 {
38 namespace OSDK
39 {
40 
45 class PosixThreadManager : public ThreadAbstract
46 {
47 public:
49  {
50  }
52 
53  void init();
54 
56 public:
57  void lockRecvContainer();
58  void freeRecvContainer();
59 
60  void lockMSG();
61  void freeMSG();
62 
63  void lockACK();
64  void freeACK();
65 
66  void lockProtocolHeader();
67  void freeProtocolHeader();
68 
69  void lockNonBlockCBAck();
70  void freeNonBlockCBAck();
71 
72  void lockStopCond();
73  void freeStopCond();
74 
75  void lockFrame();
76  void freeFrame();
77 
78  void notify();
79  void notifyNonBlockCBAckRecv();
80  void wait(int timeoutInSeconds);
81  void nonBlockWait();
82 
83 private:
84  pthread_mutex_t m_memLock;
85  pthread_mutex_t m_msgLock;
86  pthread_mutex_t m_ackLock;
87  pthread_cond_t m_ackRecvCv;
88 
89  pthread_mutex_t m_headerLock;
90  pthread_mutex_t m_nbAckLock;
91  pthread_cond_t m_nbAckRecv;
92 
94  pthread_mutex_t m_stopCondLock;
95 
97  pthread_mutex_t m_frameLock;
98 };
99 
100 } // namespace OSDK
101 } // namespace DJI
102 
103 #endif // POSIXTHREADMANAGER_H
Data protection and thread management abstract classes.
void lockRecvContainer()
Implementing virtual functions from ThreadManager.
POSIX-Compatible Data Protection and Condition Variables for *NIX platforms.
Definition: posix_thread_manager.hpp:45
handle array of characters
Definition: commondatarangehandler.h:14