You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

msgqueuethread.cpp 418 B

8 years ago
1234567891011121314151617181920212223242526272829
  1. #include "msgqueuethread.h"
  2. #include <thread>
  3. MsgQueueThread::MsgQueueThread()
  4. {
  5. }
  6. void MsgQueueThread::setHandler(MsgQueueThread::Handler handler)
  7. {
  8. }
  9. void MsgQueueThread::start()
  10. {
  11. if (mRun)
  12. return;
  13. mRun=true;
  14. thread thd(&MsgQueueThread::loop, this);
  15. thd.detach();
  16. }
  17. void MsgQueueThread::stop()
  18. {
  19. mRun=false;
  20. unique_lock<mutex> lock(mQueueMutex);
  21. mQueueCnd.notify_all();
  22. }

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)