[MINOR] pollers should not use MY_FD_*
This commit is contained in:
parent
42c7659669
commit
b3107b9383
40
src/fd.c
40
src/fd.c
|
@ -163,16 +163,16 @@ int epoll_loop(int action)
|
||||||
sr = (rn >> count) & 1;
|
sr = (rn >> count) & 1;
|
||||||
sw = (wn >> count) & 1;
|
sw = (wn >> count) & 1;
|
||||||
#else
|
#else
|
||||||
pr = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&ro);
|
pr = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&ro);
|
||||||
pw = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wo);
|
pw = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wo);
|
||||||
sr = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&rn);
|
sr = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&rn);
|
||||||
sw = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wn);
|
sw = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wn);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
pr = MY_FD_ISSET(fd, PrevReadEvent);
|
pr = FD_ISSET(fd, PrevReadEvent);
|
||||||
pw = MY_FD_ISSET(fd, PrevWriteEvent);
|
pw = FD_ISSET(fd, PrevWriteEvent);
|
||||||
sr = MY_FD_ISSET(fd, StaticReadEvent);
|
sr = FD_ISSET(fd, StaticReadEvent);
|
||||||
sw = MY_FD_ISSET(fd, StaticWriteEvent);
|
sw = FD_ISSET(fd, StaticWriteEvent);
|
||||||
#endif
|
#endif
|
||||||
if (!((sr^pr) | (sw^pw)))
|
if (!((sr^pr) | (sw^pw)))
|
||||||
continue;
|
continue;
|
||||||
|
@ -234,14 +234,14 @@ int epoll_loop(int action)
|
||||||
for (count = 0; count < status; count++) {
|
for (count = 0; count < status; count++) {
|
||||||
fd = epoll_events[count].data.fd;
|
fd = epoll_events[count].data.fd;
|
||||||
|
|
||||||
if (MY_FD_ISSET(fd, StaticReadEvent)) {
|
if (FD_ISSET(fd, StaticReadEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
if (epoll_events[count].events & ( EPOLLIN | EPOLLERR | EPOLLHUP ))
|
if (epoll_events[count].events & ( EPOLLIN | EPOLLERR | EPOLLHUP ))
|
||||||
fdtab[fd].cb[DIR_RD].f(fd);
|
fdtab[fd].cb[DIR_RD].f(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MY_FD_ISSET(fd, StaticWriteEvent)) {
|
if (FD_ISSET(fd, StaticWriteEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
if (epoll_events[count].events & ( EPOLLOUT | EPOLLERR | EPOLLHUP ))
|
if (epoll_events[count].events & ( EPOLLOUT | EPOLLERR | EPOLLHUP ))
|
||||||
|
@ -317,12 +317,12 @@ int poll_loop(int action)
|
||||||
sr = (rn >> count) & 1;
|
sr = (rn >> count) & 1;
|
||||||
sw = (wn >> count) & 1;
|
sw = (wn >> count) & 1;
|
||||||
#else
|
#else
|
||||||
sr = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&rn);
|
sr = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&rn);
|
||||||
sw = MY_FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wn);
|
sw = FD_ISSET(fd&((1<<INTBITS)-1), (typeof(fd_set*))&wn);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
sr = MY_FD_ISSET(fd, StaticReadEvent);
|
sr = FD_ISSET(fd, StaticReadEvent);
|
||||||
sw = MY_FD_ISSET(fd, StaticWriteEvent);
|
sw = FD_ISSET(fd, StaticWriteEvent);
|
||||||
#endif
|
#endif
|
||||||
if ((sr|sw)) {
|
if ((sr|sw)) {
|
||||||
poll_events[nbfd].fd = fd;
|
poll_events[nbfd].fd = fd;
|
||||||
|
@ -346,14 +346,14 @@ int poll_loop(int action)
|
||||||
/* ok, we found one active fd */
|
/* ok, we found one active fd */
|
||||||
status--;
|
status--;
|
||||||
|
|
||||||
if (MY_FD_ISSET(fd, StaticReadEvent)) {
|
if (FD_ISSET(fd, StaticReadEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
if (poll_events[count].revents & ( POLLIN | POLLERR | POLLHUP ))
|
if (poll_events[count].revents & ( POLLIN | POLLERR | POLLHUP ))
|
||||||
fdtab[fd].cb[DIR_RD].f(fd);
|
fdtab[fd].cb[DIR_RD].f(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MY_FD_ISSET(fd, StaticWriteEvent)) {
|
if (FD_ISSET(fd, StaticWriteEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
if (poll_events[count].revents & ( POLLOUT | POLLERR | POLLHUP ))
|
if (poll_events[count].revents & ( POLLOUT | POLLERR | POLLHUP ))
|
||||||
|
@ -433,9 +433,9 @@ int select_loop(int action)
|
||||||
|
|
||||||
// /* just a verification code, needs to be removed for performance */
|
// /* just a verification code, needs to be removed for performance */
|
||||||
// for (i=0; i<maxfd; i++) {
|
// for (i=0; i<maxfd; i++) {
|
||||||
// if (MY_FD_ISSET(i, ReadEvent) != MY_FD_ISSET(i, StaticReadEvent))
|
// if (FD_ISSET(i, ReadEvent) != FD_ISSET(i, StaticReadEvent))
|
||||||
// abort();
|
// abort();
|
||||||
// if (MY_FD_ISSET(i, WriteEvent) != MY_FD_ISSET(i, StaticWriteEvent))
|
// if (FD_ISSET(i, WriteEvent) != FD_ISSET(i, StaticWriteEvent))
|
||||||
// abort();
|
// abort();
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
@ -464,13 +464,13 @@ int select_loop(int action)
|
||||||
/* if we specify read first, the accepts and zero reads will be
|
/* if we specify read first, the accepts and zero reads will be
|
||||||
* seen first. Moreover, system buffers will be flushed faster.
|
* seen first. Moreover, system buffers will be flushed faster.
|
||||||
*/
|
*/
|
||||||
if (MY_FD_ISSET(fd, ReadEvent)) {
|
if (FD_ISSET(fd, ReadEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
fdtab[fd].cb[DIR_RD].f(fd);
|
fdtab[fd].cb[DIR_RD].f(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MY_FD_ISSET(fd, WriteEvent)) {
|
if (FD_ISSET(fd, WriteEvent)) {
|
||||||
if (fdtab[fd].state == FD_STCLOSE)
|
if (fdtab[fd].state == FD_STCLOSE)
|
||||||
continue;
|
continue;
|
||||||
fdtab[fd].cb[DIR_WR].f(fd);
|
fdtab[fd].cb[DIR_WR].f(fd);
|
||||||
|
|
Loading…
Reference in New Issue