event

Catalogue
  1. 1. @lib_event_init() 初始化全局变量和申请内存空间
  2. 2. @lib_event_wait() 轮训获取可读可写事件
1
2
3
4
5
6
lib_event_init();

dosthing...


lib_event_wait();

@lib_event_init() 初始化全局变量和申请内存空间

1
2
3
LibG;
LibG.poll
LibG.poll.epollfd;

@lib_event_wait() 轮训获取可读可写事件

timer、socket、server、sleep等模块依赖于event,所以需要显示调用event

1
2
3
while(LibG.running){
epoll_wait(....)
}