aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/iomgr/pollset_posix.c12
-rw-r--r--src/core/iomgr/tcp_windows.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index 6bd1b61f24..2a3ae4bb75 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -187,6 +187,12 @@ void grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker *worker,
if (pollset->shutting_down) {
goto done;
}
+ if (pollset->in_flight_cbs) {
+ /* Give do_promote priority so we don't starve it out */
+ gpr_mu_unlock(&pollset->mu);
+ gpr_mu_lock(&pollset->mu);
+ goto done;
+ }
if (!pollset->kicked_without_pollers) {
push_front_worker(pollset, worker);
added_worker = 1;
@@ -422,12 +428,6 @@ static void basic_pollset_maybe_work(grpc_pollset *pollset,
int r;
int nfds;
- if (pollset->in_flight_cbs) {
- /* Give do_promote priority so we don't starve it out */
- gpr_mu_unlock(&pollset->mu);
- gpr_mu_lock(&pollset->mu);
- return;
- }
fd = pollset->data.ptr;
if (fd && grpc_fd_is_orphaned(fd)) {
GRPC_FD_UNREF(fd, "basicpoll");
diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c
index fe3673c607..725c18e6cc 100644
--- a/src/core/iomgr/tcp_windows.c
+++ b/src/core/iomgr/tcp_windows.c
@@ -144,7 +144,7 @@ static int on_read(grpc_tcp *tcp, int success) {
int do_abort = 0;
if (success) {
- if (socket->read_info.wsa_error != 0) {
+ if (socket->read_info.wsa_error != 0 && !tcp->shutting_down) {
if (socket->read_info.wsa_error != WSAECONNRESET) {
char *utf8_message = gpr_format_message(info->wsa_error);
gpr_log(GPR_ERROR, "ReadFile overlapped error: %s", utf8_message);
@@ -153,7 +153,7 @@ static int on_read(grpc_tcp *tcp, int success) {
success = 0;
gpr_slice_unref(tcp->read_slice);
} else {
- if (info->bytes_transfered != 0) {
+ if (info->bytes_transfered != 0 && !tcp->shutting_down) {
sub = gpr_slice_sub_no_ref(tcp->read_slice, 0, info->bytes_transfered);
gpr_slice_buffer_add(tcp->read_slices, sub);
success = 1;