12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #include "Notify_Thread.h"
- #include "ResDataObject.h"
- #include "common_api.h"
- #include "LogLocalHelper.h" // 模块名接口声明(共用)
- #include "Log4CPP.h"
- //extern Log4CPP::Logger* mLog::gLogger;
- Notify_Thread::Notify_Thread()
- {
- m_pDPC = NULL;
- }
- Notify_Thread::~Notify_Thread()
- {
- }
- bool Notify_Thread::Exec()
- {
- //check exit flag
- if (WaitTheThreadEndSign(0) == true)
- {
- return false;
- }
- //FERROR("Drv NotifyT Entry");
- if (CheckForPause())
- {
- FERROR("Got Pause Evt.Wait Resume");
- if (WaitforResume() == false)
- {
- FERROR("Failed Wait Resume Evt.Exit Thread");
- return false;
- }
- FERROR("Got Resume Evt.Go Normal");
- }
- //dpc work
- if (m_pDPC)
- {
- std::vector<std::shared_ptr<LinuxEvent>> wait = { m_ExitFlag, m_PauseEvt };
- if (m_pDPC->OnNotify(wait,2) == 0)
- {
- FERROR("OnNotify return False");
- return false;
- }
- return true;
- }
- return false;
- }
- void Notify_Thread::SetDPC(DriverDPC *pDPC)
- {
- m_pDPC = pDPC;
- }
|