__monitor.hpp 493 B

1234567891011121314151617181920
  1. #ifndef AFUN___MONITOR_HPP
  2. #define AFUN___MONITOR_HPP
  3. #include "pthread.h"
  4. #include "macro.hpp"
  5. typedef struct af_Monitor af_Monitor;
  6. struct af_Monitor {
  7. struct af_Environment *env;
  8. pthread_t thread;
  9. bool exit; // 外部通知守护线程结束
  10. pthread_mutex_t lock;
  11. pthread_cond_t cond;
  12. };
  13. #include "__env.hpp"
  14. AFUN_CORE_NO_EXPORT af_Monitor *makeMonitor(af_Environment *env);
  15. AFUN_CORE_NO_EXPORT void freeMonitor(af_Environment *env);
  16. #endif //AFUN___MONITOR_HPP