| 31 | } |
| 32 | |
| 33 | void aio_timer_delay_free::timer_callback(unsigned int /* id */) |
| 34 | { |
| 35 | std::set<aio_delay_free*>::iterator it, next; |
| 36 | for (it = gc_set_.begin(); it != gc_set_.end(); it = next) { |
| 37 | next = it; |
| 38 | ++next; |
| 39 | if (!(*it)->locked()) { |
| 40 | (*it)->destroy(); |
| 41 | gc_set_.erase(it); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // �����¼������Ƿ��������ظ���ʱ�����̣����ñ���ʱ������ |
| 46 | if (!gc_set_.empty()) { |
| 47 | handle_.set_timer(this, 100000, DELAY_TIMER_ID); |
| 48 | } else { |
| 49 | handle_.del_timer(this, DELAY_TIMER_ID); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | bool aio_timer_delay_free::add(aio_delay_free* callback) |
| 54 | { |