MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
#include <timeout_info.h>
Public 成员函数 | |
TimeoutInfo (time_t deadline_) | |
void | attach () |
void | detach () |
bool | has_timed_out () |
Private 成员函数 | |
TimeoutInfo (const TimeoutInfo &ti) | |
TimeoutInfo & | operator= (const TimeoutInfo &ti) |
Private 属性 | |
time_t | deadline_ |
bool | is_timed_out_ |
int | ref_cnt_ |
pthread_mutex_t | mutex_ |
Timeout info class used to judge if a certain deadline_ has reached or not. It's good to use handle-body to automate the reference count increase/decrease. However, explicit attach/detach interfaces are used here to simplify the implementation.
common::TimeoutInfo::TimeoutInfo | ( | time_t | deadline_ | ) |
Constructor
[in] | deadline_ | deadline_ of this timeout |