diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-21 17:15:19 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-21 17:15:19 -0700 |
commit | ba496454b2f0909a64845f1305f3b0a81073a4f1 (patch) | |
tree | d01a5956fb76ebd83d89fb6c14bf3f9cf082f727 /src/core/iomgr | |
parent | 294d0ecc05097753982e89f14bb0b63c67451038 (diff) |
Fixes
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/alarm.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/fd_posix.h | 1 | ||||
-rw-r--r-- | src/core/iomgr/iomgr.c | 13 | ||||
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c index 146bda477d..da265d4e50 100644 --- a/src/core/iomgr/alarm.c +++ b/src/core/iomgr/alarm.c @@ -224,7 +224,7 @@ void grpc_alarm_cancel(grpc_alarm *alarm, grpc_call_list *call_list) { shard_type *shard = &g_shards[shard_idx(alarm)]; gpr_mu_lock(&shard->mu); if (!alarm->triggered) { - grpc_call_list_add(call_list, &alarm->closure, 1); + grpc_call_list_add(call_list, &alarm->closure, 0); alarm->triggered = 1; if (alarm->heap_index == INVALID_HEAP_INDEX) { list_remove(alarm); diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h index f435e2d3f9..607cba6181 100644 --- a/src/core/iomgr/fd_posix.h +++ b/src/core/iomgr/fd_posix.h @@ -36,7 +36,6 @@ #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/pollset.h" -#include "src/core/iomgr/workqueue.h" #include <grpc/support/atm.h> #include <grpc/support/sync.h> #include <grpc/support/time.h> diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c index 029c689982..5cb20a7ba0 100644 --- a/src/core/iomgr/iomgr.c +++ b/src/core/iomgr/iomgr.c @@ -194,13 +194,14 @@ int grpc_call_list_empty(grpc_call_list call_list) { } void grpc_call_list_move(grpc_call_list *src, grpc_call_list *dst) { - if (dst->head == NULL) { - *dst = *src; - return; - } if (src->head == NULL) { return; } - dst->tail->next = src->head; - dst->tail = src->tail; + if (dst->head == NULL) { + *dst = *src; + } else { + dst->tail->next = src->head; + dst->tail = src->tail; + } + src->head = src->tail = NULL; } diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 1040716179..daca2f6daa 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -205,7 +205,7 @@ void grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker *worker, added_worker = 1; gpr_tls_set(&g_current_thread_poller, (gpr_intptr)pollset); pollset->vtable->maybe_work_and_unlock(pollset, worker, deadline, now, - NULL); + call_list); locked = 0; gpr_tls_set(&g_current_thread_poller, 0); } else { @@ -400,6 +400,7 @@ static void basic_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd, up_args = gpr_malloc(sizeof(*up_args)); up_args->fd = fd; up_args->original_vtable = pollset->vtable; + up_args->pollset = pollset; up_args->promotion_closure.cb = basic_do_promote; up_args->promotion_closure.cb_arg = up_args; |