During the development of sheepkeeper, I noticed my patchset is too large and some part of it are not only for sheepkeeper. For easy review and discussion, I'm sending them as an independent patchset. This patchset implements a new mechanism of event loop for more flexible controll. I believe sheep itself can benefit from this change. v2: * change name of enum event_ret. e.g. EVENT_RET_DONE -> EVENT_LOOP_NOP * eliminate an unnecessary array Hitoshi Mitake (2): lib: prioritize events for epoll() and enhance event loop sheep: break event loop when killed with SIGTERM include/event.h | 22 +++++++++++- lib/event.c | 84 +++++++++++++++++++++++++++++++++++++++++---- sheep/cluster/accord.c | 6 ++- sheep/cluster/corosync.c | 4 +- sheep/cluster/local.c | 4 ++- sheep/cluster/zookeeper.c | 8 +++-- sheep/request.c | 33 +++++++++++------- sheep/sheep.c | 8 +++- sheep/trace/trace.c | 16 +++++--- sheep/work.c | 6 ++- 10 files changed, 151 insertions(+), 40 deletions(-) -- 1.7.5.1 |