acl/lib_fiber/cpp/include/fiber/fiber_cond.hpp

53 lines
953 B
C++
Raw Normal View History

#pragma once
2018-11-30 14:38:22 +08:00
#include "fiber_cpp_define.hpp"
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>
2018-11-30 14:38:22 +08:00
*/
class FIBER_CPP_API fiber_cond
2018-11-30 14:38:22 +08:00
{
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>
2018-11-30 14:38:22 +08:00
* @param event {fiber_event&}
* @param timeout {int} <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>ʱ
2018-11-30 14:38:22 +08:00
*/
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>
2018-11-30 14:38:22 +08:00
*/
bool notify(void);
public:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> C <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2018-11-30 14:38:22 +08:00
* @return {ACL_FIBER_COND*}
*/
ACL_FIBER_COND* get_cond(void) const
{
return cond_;
}
private:
ACL_FIBER_COND* cond_;
fiber_cond(const fiber_cond&);
void operator=(const fiber_cond&);
2018-11-30 14:38:22 +08:00
};
}