2018-11-30 14:38:22 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
#include "fiber_cpp_define.hpp"
|
|
|
|
|
|
|
|
|
|
#if !defined(_WIN32) && !defined(_WIN64)
|
|
|
|
|
|
2018-12-01 12:04:36 +08:00
|
|
|
|
struct ACL_FIBER_COND;
|
2018-11-30 14:38:22 +08:00
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
|
|
class fiber_event;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
class FIBER_CPP_API fiber_cond
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
fiber_cond(void);
|
|
|
|
|
~fiber_cond(void);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param event {fiber_event&}
|
2018-11-30 18:26:46 +08:00
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD>ʱ<EFBFBD>ȴ<EFBFBD>ʱ<EFBFBD>䣨<EFBFBD><EFBFBD><EFBFBD>룩
|
2018-11-30 14:38:22 +08:00
|
|
|
|
* @return {bool} <EFBFBD>ɹ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> true<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> false <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ʱ
|
|
|
|
|
*/
|
2018-12-07 13:50:42 +08:00
|
|
|
|
bool wait(fiber_event& event, int timeout = -1);
|
2018-11-30 14:38:22 +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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> true<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> false <EFBFBD><EFBFBD>ʾʧ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
bool notify(void);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> C <EFBFBD>汾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_FIBER_COND*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_FIBER_COND* get_cond(void) const
|
|
|
|
|
{
|
|
|
|
|
return cond_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ACL_FIBER_COND* cond_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|