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

53 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
2018-11-30 14:38:22 +08:00
#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;
/**
* 线线
2018-11-30 14:38:22 +08:00
*/
class FIBER_CPP_API fiber_cond : public noncopyable
2018-11-30 14:38:22 +08:00
{
public:
fiber_cond(void);
~fiber_cond(void);
/**
*
2018-11-30 14:38:22 +08:00
* @param event {fiber_event&}
* @param timeout {int}
* @return {bool} true false
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
/**
*
* 线
* @return {bool} true false
2018-11-30 14:38:22 +08:00
*/
bool notify(void);
public:
/**
* C
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_;
};
}
#endif