MT#55283 remove poller_isblocked

There is negligible to non existant benefit to this loop condition
shortcut.

Change-Id: I7919deec0a65d0c025da0523c3657e3f7a643017
pull/1826/head
Richard Fuchs 2 years ago
parent 58cbd2f21c
commit 128e84edbf

@ -292,30 +292,6 @@ void poller_error(struct poller *p, void *fdp) {
it->blocked = 1; it->blocked = 1;
} }
int poller_isblocked(struct poller *p, void *fdp) {
int fd = GPOINTER_TO_INT(fdp);
int ret;
if (!p || fd < 0)
return -1;
LOCK(&p->lock);
ret = -1;
if (fd >= p->items->len)
goto out;
struct poller_item_int *it;
if (!(it = p->items->pdata[fd]))
goto out;
if (!it->item.writeable)
goto out;
ret = it->blocked ? 1 : 0;
out:
return ret;
}
void poller_loop(void *d) { void poller_loop(void *d) {
struct poller *p = d; struct poller *p = d;
int poller_size = rtpe_common_config_ptr->poller_size; int poller_size = rtpe_common_config_ptr->poller_size;

@ -35,7 +35,6 @@ bool poller_del_item(struct poller *, int);
bool poller_del_item_callback(struct poller *, int, void (*)(void *), void *); bool poller_del_item_callback(struct poller *, int, void (*)(void *), void *);
void poller_blocked(struct poller *, void *); void poller_blocked(struct poller *, void *);
int poller_isblocked(struct poller *, void *);
void poller_error(struct poller *, void *); void poller_error(struct poller *, void *);
void poller_loop(void *); void poller_loop(void *);

@ -209,7 +209,7 @@ void streambuf_write(struct streambuf *b, const char *s, unsigned int len) {
mutex_lock(&b->lock); mutex_lock(&b->lock);
while (len && !poller_isblocked(b->poller, b->fd_ptr)) { while (len) {
out = (len > 1024) ? 1024 : len; out = (len > 1024) ? 1024 : len;
ret = b->funcs->write(b->fd_ptr, s, out); ret = b->funcs->write(b->fd_ptr, s, out);

Loading…
Cancel
Save