]>
git.proxmox.com Git - ceph.git/blob - ceph/src/msg/async/EventSelect.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 UnitedStack <haomai@unitedstack.com>
8 * Author: Haomai Wang <haomaiwang@gmail.com>
10 * This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License version 2.1, as published by the Free Software
13 * Foundation. See file COPYING.
17 #ifndef CEPH_MSG_EVENTSELECT_H
18 #define CEPH_MSG_EVENTSELECT_H
22 class SelectDriver
: public EventDriver
{
24 /* We need to have a copy of the fd sets as it's not safe to reuse
25 * FD sets after select(). */
31 explicit SelectDriver(CephContext
*c
): max_fd(0), cct(c
) {}
32 ~SelectDriver() override
{}
34 int init(EventCenter
*c
, int nevent
) override
;
35 int add_event(int fd
, int cur_mask
, int add_mask
) override
;
36 int del_event(int fd
, int cur_mask
, int del_mask
) override
;
37 int resize_events(int newsize
) override
;
38 int event_wait(vector
<FiredFileEvent
> &fired_events
,
39 struct timeval
*tp
) override
;