mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
remove obsoleted recalc code
svn:r581
This commit is contained in:
parent
fa89d661d9
commit
fbe24f43ab
@ -110,7 +110,6 @@ RB_GENERATE(event_map, event_entry, node, compare);
|
|||||||
void *win32_init (struct event_base *);
|
void *win32_init (struct event_base *);
|
||||||
int win32_insert (void *, struct event *);
|
int win32_insert (void *, struct event *);
|
||||||
int win32_del (void *, struct event *);
|
int win32_del (void *, struct event *);
|
||||||
int win32_recalc (struct event_base *base, void *, int);
|
|
||||||
int win32_dispatch (struct event_base *base, void *, struct timeval *);
|
int win32_dispatch (struct event_base *base, void *, struct timeval *);
|
||||||
void win32_dealloc (struct event_base *, void *);
|
void win32_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -119,7 +118,6 @@ struct eventop win32ops = {
|
|||||||
win32_init,
|
win32_init,
|
||||||
win32_insert,
|
win32_insert,
|
||||||
win32_del,
|
win32_del,
|
||||||
win32_recalc,
|
|
||||||
win32_dispatch,
|
win32_dispatch,
|
||||||
win32_dealloc,
|
win32_dealloc,
|
||||||
0
|
0
|
||||||
@ -268,15 +266,6 @@ win32_init(struct event_base *_base)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
win32_recalc(struct event_base *base, void *arg, int max)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
return (evsignal_recalc());
|
|
||||||
#endif
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
win32_insert(void *op, struct event *ev)
|
win32_insert(void *op, struct event *ev)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,6 @@ struct devpollop {
|
|||||||
void *devpoll_init (struct event_base *);
|
void *devpoll_init (struct event_base *);
|
||||||
int devpoll_add (void *, struct event *);
|
int devpoll_add (void *, struct event *);
|
||||||
int devpoll_del (void *, struct event *);
|
int devpoll_del (void *, struct event *);
|
||||||
int devpoll_recalc (struct event_base *, void *, int);
|
|
||||||
int devpoll_dispatch (struct event_base *, void *, struct timeval *);
|
int devpoll_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
void devpoll_dealloc (struct event_base *, void *);
|
void devpoll_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -81,7 +80,6 @@ struct eventop devpollops = {
|
|||||||
devpoll_init,
|
devpoll_init,
|
||||||
devpoll_add,
|
devpoll_add,
|
||||||
devpoll_del,
|
devpoll_del,
|
||||||
devpoll_recalc,
|
|
||||||
devpoll_dispatch,
|
devpoll_dispatch,
|
||||||
devpoll_dealloc
|
devpoll_dealloc
|
||||||
};
|
};
|
||||||
|
2
epoll.c
2
epoll.c
@ -72,7 +72,6 @@ struct epollop {
|
|||||||
void *epoll_init (struct event_base *);
|
void *epoll_init (struct event_base *);
|
||||||
int epoll_add (void *, struct event *);
|
int epoll_add (void *, struct event *);
|
||||||
int epoll_del (void *, struct event *);
|
int epoll_del (void *, struct event *);
|
||||||
int epoll_recalc (struct event_base *, void *, int);
|
|
||||||
int epoll_dispatch (struct event_base *, void *, struct timeval *);
|
int epoll_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
void epoll_dealloc (struct event_base *, void *);
|
void epoll_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -81,7 +80,6 @@ struct eventop epollops = {
|
|||||||
epoll_init,
|
epoll_init,
|
||||||
epoll_add,
|
epoll_add,
|
||||||
epoll_del,
|
epoll_del,
|
||||||
epoll_recalc,
|
|
||||||
epoll_dispatch,
|
epoll_dispatch,
|
||||||
epoll_dealloc,
|
epoll_dealloc,
|
||||||
1 /* need reinit */
|
1 /* need reinit */
|
||||||
|
@ -41,7 +41,6 @@ struct eventop {
|
|||||||
void *(*init)(struct event_base *);
|
void *(*init)(struct event_base *);
|
||||||
int (*add)(void *, struct event *);
|
int (*add)(void *, struct event *);
|
||||||
int (*del)(void *, struct event *);
|
int (*del)(void *, struct event *);
|
||||||
int (*recalc)(struct event_base *, void *, int);
|
|
||||||
int (*dispatch)(struct event_base *, void *, struct timeval *);
|
int (*dispatch)(struct event_base *, void *, struct timeval *);
|
||||||
void (*dealloc)(struct event_base *, void *);
|
void (*dealloc)(struct event_base *, void *);
|
||||||
/* set if we need to reinitialize the event base */
|
/* set if we need to reinitialize the event base */
|
||||||
|
4
event.c
4
event.c
@ -443,10 +443,6 @@ event_base_loop(struct event_base *base, int flags)
|
|||||||
evsignal_base = base;
|
evsignal_base = base;
|
||||||
done = 0;
|
done = 0;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
/* Calculate the initial events that we are waiting for */
|
|
||||||
if (evsel->recalc(base, evbase, 0) == -1)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
/* Terminate the loop if we have been asked to */
|
/* Terminate the loop if we have been asked to */
|
||||||
if (base->event_gotterm) {
|
if (base->event_gotterm) {
|
||||||
base->event_gotterm = 0;
|
base->event_gotterm = 0;
|
||||||
|
18
evport.c
18
evport.c
@ -47,8 +47,7 @@
|
|||||||
* necessary when large fd's come in. reassociate() takes care of maintaining
|
* necessary when large fd's come in. reassociate() takes care of maintaining
|
||||||
* the proper file-descriptor/event-port associations.
|
* the proper file-descriptor/event-port associations.
|
||||||
*
|
*
|
||||||
* As in the select(2) implementation, signals are handled by evsignal, and
|
* As in the select(2) implementation, signals are handled by evsignal.
|
||||||
* evport_recalc does almost nothing.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -119,7 +118,6 @@ struct evport_data {
|
|||||||
static void* evport_init (struct event_base *);
|
static void* evport_init (struct event_base *);
|
||||||
static int evport_add (void *, struct event *);
|
static int evport_add (void *, struct event *);
|
||||||
static int evport_del (void *, struct event *);
|
static int evport_del (void *, struct event *);
|
||||||
static int evport_recalc (struct event_base *, void *, int);
|
|
||||||
static int evport_dispatch (struct event_base *, void *, struct timeval *);
|
static int evport_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
static void evport_dealloc (struct event_base *, void *);
|
static void evport_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -128,7 +126,6 @@ const struct eventop evportops = {
|
|||||||
evport_init,
|
evport_init,
|
||||||
evport_add,
|
evport_add,
|
||||||
evport_del,
|
evport_del,
|
||||||
evport_recalc,
|
|
||||||
evport_dispatch,
|
evport_dispatch,
|
||||||
evport_dealloc
|
evport_dealloc
|
||||||
};
|
};
|
||||||
@ -395,19 +392,6 @@ evport_dispatch(struct event_base *base, void *arg, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copied from the version in select.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
evport_recalc(struct event_base *base, void *arg, int max)
|
|
||||||
{
|
|
||||||
struct evport_data *evpd = arg;
|
|
||||||
check_evportop(evpd);
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds the given event (so that you will be notified when it happens via
|
* Adds the given event (so that you will be notified when it happens via
|
||||||
* the callback function).
|
* the callback function).
|
||||||
|
8
kqueue.c
8
kqueue.c
@ -77,7 +77,6 @@ struct kqop {
|
|||||||
void *kq_init (struct event_base *);
|
void *kq_init (struct event_base *);
|
||||||
int kq_add (void *, struct event *);
|
int kq_add (void *, struct event *);
|
||||||
int kq_del (void *, struct event *);
|
int kq_del (void *, struct event *);
|
||||||
int kq_recalc (struct event_base *, void *, int);
|
|
||||||
int kq_dispatch (struct event_base *, void *, struct timeval *);
|
int kq_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
int kq_insert (struct kqop *, struct kevent *);
|
int kq_insert (struct kqop *, struct kevent *);
|
||||||
void kq_dealloc (struct event_base *, void *);
|
void kq_dealloc (struct event_base *, void *);
|
||||||
@ -87,7 +86,6 @@ const struct eventop kqops = {
|
|||||||
kq_init,
|
kq_init,
|
||||||
kq_add,
|
kq_add,
|
||||||
kq_del,
|
kq_del,
|
||||||
kq_recalc,
|
|
||||||
kq_dispatch,
|
kq_dispatch,
|
||||||
kq_dealloc,
|
kq_dealloc,
|
||||||
1 /* need reinit */
|
1 /* need reinit */
|
||||||
@ -154,12 +152,6 @@ kq_init(struct event_base *base)
|
|||||||
return (kqueueop);
|
return (kqueueop);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
kq_recalc(struct event_base *base, void *arg, int max)
|
|
||||||
{
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
kq_insert(struct kqop *kqop, struct kevent *kev)
|
kq_insert(struct kqop *kqop, struct kevent *kev)
|
||||||
{
|
{
|
||||||
|
13
poll.c
13
poll.c
@ -68,7 +68,6 @@ struct pollop {
|
|||||||
void *poll_init (struct event_base *);
|
void *poll_init (struct event_base *);
|
||||||
int poll_add (void *, struct event *);
|
int poll_add (void *, struct event *);
|
||||||
int poll_del (void *, struct event *);
|
int poll_del (void *, struct event *);
|
||||||
int poll_recalc (struct event_base *, void *, int);
|
|
||||||
int poll_dispatch (struct event_base *, void *, struct timeval *);
|
int poll_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
void poll_dealloc (struct event_base *, void *);
|
void poll_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -77,7 +76,6 @@ const struct eventop pollops = {
|
|||||||
poll_init,
|
poll_init,
|
||||||
poll_add,
|
poll_add,
|
||||||
poll_del,
|
poll_del,
|
||||||
poll_recalc,
|
|
||||||
poll_dispatch,
|
poll_dispatch,
|
||||||
poll_dealloc,
|
poll_dealloc,
|
||||||
0
|
0
|
||||||
@ -100,17 +98,6 @@ poll_init(struct event_base *base)
|
|||||||
return (pollop);
|
return (pollop);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Called with the highest fd that we know about. If it is 0, completely
|
|
||||||
* recalculate everything.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
poll_recalc(struct event_base *base, void *arg, int max)
|
|
||||||
{
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CHECK_INVARIANTS
|
#ifdef CHECK_INVARIANTS
|
||||||
static void
|
static void
|
||||||
poll_check_ok(struct pollop *pop)
|
poll_check_ok(struct pollop *pop)
|
||||||
|
17
select.c
17
select.c
@ -73,7 +73,6 @@ struct selectop {
|
|||||||
void *select_init (struct event_base *);
|
void *select_init (struct event_base *);
|
||||||
int select_add (void *, struct event *);
|
int select_add (void *, struct event *);
|
||||||
int select_del (void *, struct event *);
|
int select_del (void *, struct event *);
|
||||||
int select_recalc (struct event_base *, void *, int);
|
|
||||||
int select_dispatch (struct event_base *, void *, struct timeval *);
|
int select_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
void select_dealloc (struct event_base *, void *);
|
void select_dealloc (struct event_base *, void *);
|
||||||
|
|
||||||
@ -82,7 +81,6 @@ const struct eventop selectops = {
|
|||||||
select_init,
|
select_init,
|
||||||
select_add,
|
select_add,
|
||||||
select_del,
|
select_del,
|
||||||
select_recalc,
|
|
||||||
select_dispatch,
|
select_dispatch,
|
||||||
select_dealloc,
|
select_dealloc,
|
||||||
0
|
0
|
||||||
@ -136,21 +134,6 @@ check_selectop(struct selectop *sop)
|
|||||||
#define check_selectop(sop) do { (void) sop; } while (0)
|
#define check_selectop(sop) do { (void) sop; } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Called with the highest fd that we know about. If it is 0, completely
|
|
||||||
* recalculate everything.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
select_recalc(struct event_base *base, void *arg, int max)
|
|
||||||
{
|
|
||||||
struct selectop *sop = arg;
|
|
||||||
|
|
||||||
check_selectop(sop);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
select_dispatch(struct event_base *base, void *arg, struct timeval *tv)
|
select_dispatch(struct event_base *base, void *arg, struct timeval *tv)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user