diff options
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/iocp_windows.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/pollset_windows.c | 6 | ||||
-rw-r--r-- | src/core/iomgr/tcp_server.h | 11 |
4 files changed, 9 insertions, 12 deletions
diff --git a/src/core/iomgr/iocp_windows.c b/src/core/iomgr/iocp_windows.c index 96b6f81024..759340e00e 100644 --- a/src/core/iomgr/iocp_windows.c +++ b/src/core/iomgr/iocp_windows.c @@ -57,7 +57,7 @@ static HANDLE g_iocp; static DWORD deadline_to_millis_timeout(gpr_timespec deadline, gpr_timespec now) { gpr_timespec timeout; - static const int max_spin_polling_us = 10; + static const int64_t max_spin_polling_us = 10; if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) { return INFINITE; } diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index a8e2e22977..19ee6650f0 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -393,7 +393,7 @@ void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, gpr_timespec now) { gpr_timespec timeout; - static const int max_spin_polling_us = 10; + static const int64_t max_spin_polling_us = 10; if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) { return -1; } diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c index 2e650ca939..02c6678363 100644 --- a/src/core/iomgr/pollset_windows.c +++ b/src/core/iomgr/pollset_windows.c @@ -212,10 +212,8 @@ void grpc_pollset_kick(grpc_pollset *p, grpc_pollset_worker *specific_worker) { grpc_iocp_kick(); } } else { - if (p->is_iocp_worker) { - if (g_active_poller == specific_worker) { - grpc_iocp_kick(); - } + if (p->is_iocp_worker && g_active_poller == specific_worker) { + grpc_iocp_kick(); } else { specific_worker->kicked = 1; gpr_cv_signal(&specific_worker->cv); diff --git a/src/core/iomgr/tcp_server.h b/src/core/iomgr/tcp_server.h index 8f3184ff1e..a39dd3bafc 100644 --- a/src/core/iomgr/tcp_server.h +++ b/src/core/iomgr/tcp_server.h @@ -40,15 +40,14 @@ /* Forward decl of grpc_tcp_server */ typedef struct grpc_tcp_server grpc_tcp_server; -typedef struct grpc_tcp_server_acceptor grpc_tcp_server_acceptor; -struct grpc_tcp_server_acceptor { +typedef struct grpc_tcp_server_acceptor { /* grpc_tcp_server_cb functions share a ref on from_server that is valid until the function returns. */ grpc_tcp_server *from_server; /* Indices that may be passed to grpc_tcp_server_port_fd(). */ unsigned port_index; unsigned fd_index; -}; +} grpc_tcp_server_acceptor; /* Called for newly connected TCP connections. */ typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg, @@ -57,7 +56,7 @@ typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg, /* Create a server, initially not bound to any ports. The caller owns one ref. If shutdown_complete is not NULL, it will be used by - grpc_tcp_server_unref(). */ + grpc_tcp_server_unref() when the ref count reaches zero. */ grpc_tcp_server *grpc_tcp_server_create(grpc_closure *shutdown_complete); /* Start listening to bound ports */ @@ -84,7 +83,7 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, unsigned port_index); /* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth (port_index) call to add_port() on this server, or -1 if the indices are out of bounds. The file descriptor remains owned by the server, and will be - cleaned up when grpc_tcp_server_destroy is called. */ + cleaned up when the ref count reaches zero. */ int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index, unsigned fd_index); @@ -97,7 +96,7 @@ grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s); void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s, grpc_closure *shutdown_starting); -/* If the recount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue +/* If the refcount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue a call (exec_ctx!=NULL) to shutdown_complete. */ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s); |