mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-07 10:18:01 +00:00
REORG: polling: rename "fd_process_spec_events()" to "fd_process_cached_events()"
This is in order to be coherent with the rest.
This commit is contained in:
parent
899d95757e
commit
033cd9d78c
@ -76,10 +76,10 @@ int list_pollers(FILE *out);
|
|||||||
*/
|
*/
|
||||||
void run_poller();
|
void run_poller();
|
||||||
|
|
||||||
/* Scan and process the speculative events. This should be called right after
|
/* Scan and process the cached events. This should be called right after
|
||||||
* the poller.
|
* the poller.
|
||||||
*/
|
*/
|
||||||
void fd_process_spec_events();
|
void fd_process_cached_events();
|
||||||
|
|
||||||
/* Mark fd <fd> as updated and allocate an entry in the update list for this if
|
/* Mark fd <fd> as updated and allocate an entry in the update list for this if
|
||||||
* it was not already there. This can be done at any time.
|
* it was not already there. This can be done at any time.
|
||||||
|
31
src/fd.c
31
src/fd.c
@ -136,29 +136,23 @@ void fd_delete(int fd)
|
|||||||
maxfd--;
|
maxfd--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan and process the speculative events. This should be called right after
|
/* Scan and process the cached events. This should be called right after
|
||||||
* the poller.
|
* the poller.
|
||||||
*/
|
*/
|
||||||
void fd_process_spec_events()
|
void fd_process_cached_events()
|
||||||
{
|
{
|
||||||
int fd, spec_idx, e;
|
int fd, entry, e;
|
||||||
|
|
||||||
/* now process speculative events if any */
|
for (entry = 0; entry < fd_cache_num; ) {
|
||||||
|
fd = fd_cache[entry];
|
||||||
for (spec_idx = 0; spec_idx < fd_cache_num; ) {
|
|
||||||
fd = fd_cache[spec_idx];
|
|
||||||
e = fdtab[fd].state;
|
e = fdtab[fd].state;
|
||||||
|
|
||||||
/*
|
/* Principle: events which are marked FD_EV_ACTIVE are processed
|
||||||
* Process the speculative events.
|
|
||||||
*
|
|
||||||
* Principle: events which are marked FD_EV_ACTIVE are processed
|
|
||||||
* with their usual I/O callback. The callback may remove the
|
* with their usual I/O callback. The callback may remove the
|
||||||
* events from the list or tag them for polling. Changes will be
|
* events from the cache or tag them for polling. Changes will be
|
||||||
* applied on next round. Speculative entries with no more activity
|
* applied on next round. Cache entries with no more activity are
|
||||||
* are automatically scheduled for removal.
|
* automatically scheduled for removal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fdtab[fd].ev &= FD_POLL_STICKY;
|
fdtab[fd].ev &= FD_POLL_STICKY;
|
||||||
|
|
||||||
if (e & FD_EV_ACTIVE_R)
|
if (e & FD_EV_ACTIVE_R)
|
||||||
@ -172,13 +166,12 @@ void fd_process_spec_events()
|
|||||||
else
|
else
|
||||||
updt_fd(fd);
|
updt_fd(fd);
|
||||||
|
|
||||||
/* if the fd was removed from the spec list, it has been
|
/* If the fd was removed from the cache, it has been
|
||||||
* replaced by the next one that we don't want to skip !
|
* replaced by the next one that we don't want to skip !
|
||||||
*/
|
*/
|
||||||
if (spec_idx < fd_cache_num && fd_cache[spec_idx] != fd)
|
if (entry < fd_cache_num && fd_cache[entry] != fd)
|
||||||
continue;
|
continue;
|
||||||
|
entry++;
|
||||||
spec_idx++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1283,7 +1283,7 @@ void run_poll_loop()
|
|||||||
|
|
||||||
/* The poller will ensure it returns around <next> */
|
/* The poller will ensure it returns around <next> */
|
||||||
cur_poller.poll(&cur_poller, next);
|
cur_poller.poll(&cur_poller, next);
|
||||||
fd_process_spec_events();
|
fd_process_cached_events();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user