aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-24 15:59:10 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-24 15:59:10 -0700
commitfe46136721acc3298a2949a7321d043180daed92 (patch)
tree2f6d7ba85a2ea51bbef0c298276ec6c83a6c663b /src/core/iomgr
parentc0cb6357e9c95893aae964599af7bb823a44976d (diff)
parent031dea1df4b6213b9f9779a824fccc6d348b8648 (diff)
Merge github.com:grpc/grpc into scalable-poll
Diffstat (limited to 'src/core/iomgr')
-rw-r--r--src/core/iomgr/pollset_posix.c7
-rw-r--r--src/core/iomgr/sockaddr_utils.c6
-rw-r--r--src/core/iomgr/tcp_posix.c4
3 files changed, 10 insertions, 7 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index ed74425555..bdfcba6e5d 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -258,7 +258,6 @@ static void unary_poll_do_promote(void *args, int success) {
grpc_pollset *pollset = up_args->pollset;
grpc_fd *fd = up_args->fd;
int do_shutdown_cb = 0;
- gpr_free(up_args);
/*
* This is quite tricky. There are a number of cases to keep in mind here:
@@ -273,8 +272,12 @@ static void unary_poll_do_promote(void *args, int success) {
/* First we need to ensure that nobody is polling concurrently */
while (pollset->counter != 0) {
grpc_pollset_kick(pollset);
- gpr_cv_wait(&pollset->cv, &pollset->mu, gpr_inf_future);
+ grpc_iomgr_add_callback(unary_poll_do_promote, up_args);
+ gpr_mu_unlock(&pollset->mu);
+ return;
}
+
+ gpr_free(up_args);
/* At this point the pollset may no longer be a unary poller. In that case
* we should just call the right add function and be done. */
/* TODO(klempner): If we're not careful this could cause infinite recursion.
diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c
index 740bbe716e..3d202a5cc8 100644
--- a/src/core/iomgr/sockaddr_utils.c
+++ b/src/core/iomgr/sockaddr_utils.c
@@ -169,8 +169,7 @@ int grpc_sockaddr_get_port(const struct sockaddr *addr) {
case AF_UNIX:
return 1;
default:
- gpr_log(GPR_ERROR, "Unknown socket family %d in %s", addr->sa_family,
- __FUNCTION__);
+ gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port", addr->sa_family);
return 0;
}
}
@@ -184,8 +183,7 @@ int grpc_sockaddr_set_port(const struct sockaddr *addr, int port) {
((struct sockaddr_in6 *)addr)->sin6_port = htons(port);
return 1;
default:
- gpr_log(GPR_ERROR, "Unknown socket family %d in %s", addr->sa_family,
- __FUNCTION__);
+ gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_set_port", addr->sa_family);
return 0;
}
}
diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c
index f7dae5f86c..cd6b2ecae6 100644
--- a/src/core/iomgr/tcp_posix.c
+++ b/src/core/iomgr/tcp_posix.c
@@ -138,8 +138,10 @@ static void slice_state_remove_prefix(grpc_tcp_slice_state *state,
native "trim the first N bytes" operation to splice */
/* TODO(klempner): This really shouldn't be modifying the current slice
unless we own the slices array. */
- *current_slice = gpr_slice_split_tail(current_slice, prefix_bytes);
+ gpr_slice tail;
+ tail = gpr_slice_split_tail(current_slice, prefix_bytes);
gpr_slice_unref(*current_slice);
+ *current_slice = tail;
return;
} else {
gpr_slice_unref(*current_slice);