2017-09-22 12:27:21 +08:00
|
|
|
|
#pragma once
|
2018-01-10 17:48:45 +08:00
|
|
|
|
#include "fiber_cpp_define.hpp"
|
|
|
|
|
|
|
|
|
|
#if !defined(_WIN32) && !defined(_WIN64)
|
2017-09-22 12:27:21 +08:00
|
|
|
|
|
|
|
|
|
struct ACL_FIBER_EVENT;
|
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
|
|
/**
|
2018-01-06 23:18:40 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>֮<EFBFBD>䡢<EFBFBD>߳<EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>֮<EFBFBD>䣬ͨ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>ȴ<EFBFBD>/֪ͨ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2017-09-22 12:27:21 +08:00
|
|
|
|
*/
|
2018-01-10 17:48:45 +08:00
|
|
|
|
class FIBER_CPP_API fiber_event
|
2017-09-22 12:27:21 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
2018-11-24 11:49:18 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>췽<EFBFBD><EFBFBD>
|
|
|
|
|
* @param use_mutex {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD>߳<EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>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D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD>Ⱥ<EFBFBD><EFBFBD><EFBFBD>⣻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD>ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ң<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ false
|
|
|
|
|
* <EFBFBD>Ը<EFBFBD>֮<EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2018-11-26 09:53:32 +08:00
|
|
|
|
fiber_event(bool use_mutex = true);
|
2017-09-22 12:27:21 +08:00
|
|
|
|
~fiber_event(void);
|
|
|
|
|
|
|
|
|
|
/**
|
2018-01-06 23:18:40 +08:00
|
|
|
|
* <EFBFBD>ȴ<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2017-09-22 12:27:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool wait(void);
|
|
|
|
|
|
|
|
|
|
/**
|
2018-01-06 23:18:40 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>Եȴ<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ռ<EFBFBD><EFBFBD>
|
2017-09-22 12:27:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool trywait(void);
|
|
|
|
|
|
|
|
|
|
/**
|
2018-01-06 23:18:40 +08:00
|
|
|
|
* <EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ֪ͨ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2017-09-22 12:27:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool notify(void);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ACL_FIBER_EVENT* event_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|
2018-01-10 17:48:45 +08:00
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|