diff options
author | David Klempner <klempner@google.com> | 2015-01-26 17:23:33 -0800 |
---|---|---|
committer | David Klempner <klempner@google.com> | 2015-01-26 17:23:33 -0800 |
commit | 8bfbc88d5f2b05bc9e703b96bfe4831521e71f1d (patch) | |
tree | c5e8442e61d564515399588908c974eaba570f8e /src/core | |
parent | 6e8bdb9a02f6030798f85af1cd32da5a6f0ba34b (diff) |
Rename wakeup_fd.[hc] to wakeup_fd_posix.[hc]
Fix the transitive closure of this change, including reintroducing
pollset_kick_posix/windows where the latter is just a stub.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/iomgr/pollset_kick.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/pollset_kick.h | 22 | ||||
-rw-r--r-- | src/core/iomgr/pollset_kick_posix.h | 51 | ||||
-rw-r--r-- | src/core/iomgr/pollset_kick_windows.h | 45 | ||||
-rw-r--r-- | src/core/iomgr/wakeup_fd_eventfd.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/wakeup_fd_pipe.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/wakeup_fd_pipe.h | 2 | ||||
-rw-r--r-- | src/core/iomgr/wakeup_fd_posix.c (renamed from src/core/iomgr/wakeup_fd.c) | 2 | ||||
-rw-r--r-- | src/core/iomgr/wakeup_fd_posix.h (renamed from src/core/iomgr/wakeup_fd.h) | 6 |
9 files changed, 113 insertions, 21 deletions
diff --git a/src/core/iomgr/pollset_kick.c b/src/core/iomgr/pollset_kick.c index 9158f9077c..e4a9caf97a 100644 --- a/src/core/iomgr/pollset_kick.c +++ b/src/core/iomgr/pollset_kick.c @@ -41,7 +41,7 @@ #include <unistd.h> #include "src/core/iomgr/socket_utils_posix.h" -#include "src/core/iomgr/wakeup_fd.h" +#include "src/core/iomgr/wakeup_fd_posix.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> diff --git a/src/core/iomgr/pollset_kick.h b/src/core/iomgr/pollset_kick.h index 5e90931261..b224177d31 100644 --- a/src/core/iomgr/pollset_kick.h +++ b/src/core/iomgr/pollset_kick.h @@ -34,22 +34,18 @@ #ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_H_ #define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_H_ -#include "src/core/iomgr/wakeup_fd.h" -#include <grpc/support/sync.h> +#include <grpc/support/port_platform.h> -/* This is an abstraction around the typical pipe mechanism for waking up a - thread sitting in a poll() style call. */ +#ifdef GPR_POSIX_SOCKET +#include "src/core/iomgr/pollset_kick_posix.h" +#endif -typedef struct grpc_kick_fd_info { - grpc_wakeup_fd_info wakeup_fd; - struct grpc_kick_fd_info *next; -} grpc_kick_fd_info; +#ifdef GPR_WIN32 +#include "src/core/iomgr/pollset_kick_windows.h" +#endif -typedef struct grpc_pollset_kick_state { - gpr_mu mu; - int kicked; - struct grpc_kick_fd_info *fd_info; -} grpc_pollset_kick_state; +/* This is an abstraction around the typical pipe mechanism for waking up a + thread sitting in a poll() style call. */ void grpc_pollset_kick_global_init(void); void grpc_pollset_kick_global_destroy(void); diff --git a/src/core/iomgr/pollset_kick_posix.h b/src/core/iomgr/pollset_kick_posix.h new file mode 100644 index 0000000000..162ae5bd8f --- /dev/null +++ b/src/core/iomgr/pollset_kick_posix.h @@ -0,0 +1,51 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_POSIX_H_ +#define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_POSIX_H_ + +#include "src/core/iomgr/wakeup_fd_posix.h" +#include <grpc/support/sync.h> + +typedef struct grpc_kick_fd_info { + grpc_wakeup_fd_info wakeup_fd; + struct grpc_kick_fd_info *next; +} grpc_kick_fd_info; + +typedef struct grpc_pollset_kick_state { + gpr_mu mu; + int kicked; + struct grpc_kick_fd_info *fd_info; +} grpc_pollset_kick_state; + +#endif /* __GRPC_INTERNALIOMGR_POLLSET_KICK_POSIX_H_ */ diff --git a/src/core/iomgr/pollset_kick_windows.h b/src/core/iomgr/pollset_kick_windows.h new file mode 100644 index 0000000000..1053230a98 --- /dev/null +++ b/src/core/iomgr/pollset_kick_windows.h @@ -0,0 +1,45 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_WINDOWS_H_ +#define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_WINDOWS_H_ + +#include <grpc/support/sync.h> + +struct grpc_kick_fd_info; + +typedef struct grpc_pollset_kick_state { + int unused; +} grpc_pollset_kick_state; + +#endif /* __GRPC_INTERNALIOMGR_POLLSET_KICK_WINDOWS_H_ */ diff --git a/src/core/iomgr/wakeup_fd_eventfd.c b/src/core/iomgr/wakeup_fd_eventfd.c index 4c495e675a..3ee7f94128 100644 --- a/src/core/iomgr/wakeup_fd_eventfd.c +++ b/src/core/iomgr/wakeup_fd_eventfd.c @@ -39,7 +39,7 @@ #include <sys/eventfd.h> #include <unistd.h> -#include "src/core/iomgr/wakeup_fd.h" +#include "src/core/iomgr/wakeup_fd_posix.h" #include <grpc/support/log.h> static void eventfd_create(grpc_wakeup_fd_info *fd_info) { diff --git a/src/core/iomgr/wakeup_fd_pipe.c b/src/core/iomgr/wakeup_fd_pipe.c index f8a0aeb606..f36e6eeb9f 100644 --- a/src/core/iomgr/wakeup_fd_pipe.c +++ b/src/core/iomgr/wakeup_fd_pipe.c @@ -32,7 +32,7 @@ */ /* TODO(klempner): Allow this code to be disabled. */ -#include "src/core/iomgr/wakeup_fd.h" +#include "src/core/iomgr/wakeup_fd_posix.h" #include <errno.h> #include <string.h> diff --git a/src/core/iomgr/wakeup_fd_pipe.h b/src/core/iomgr/wakeup_fd_pipe.h index 8e2ed85885..fc2898f570 100644 --- a/src/core/iomgr/wakeup_fd_pipe.h +++ b/src/core/iomgr/wakeup_fd_pipe.h @@ -34,7 +34,7 @@ #ifndef __GRPC_INTERNAL_IOMGR_WAKEUP_FD_PIPE_H_ #define __GRPC_INTERNAL_IOMGR_WAKEUP_FD_PIPE_H_ -#include "src/core/iomgr/wakeup_fd.h" +#include "src/core/iomgr/wakeup_fd_posix.h" extern grpc_wakeup_fd_vtable pipe_wakeup_fd_vtable; diff --git a/src/core/iomgr/wakeup_fd.c b/src/core/iomgr/wakeup_fd_posix.c index b81707f2a0..9107cf37b1 100644 --- a/src/core/iomgr/wakeup_fd.c +++ b/src/core/iomgr/wakeup_fd_posix.c @@ -31,7 +31,7 @@ * */ -#include "src/core/iomgr/wakeup_fd.h" +#include "src/core/iomgr/wakeup_fd_posix.h" #include "src/core/iomgr/wakeup_fd_pipe.h" #include <stddef.h> diff --git a/src/core/iomgr/wakeup_fd.h b/src/core/iomgr/wakeup_fd_posix.h index 225291ca60..2d785976b3 100644 --- a/src/core/iomgr/wakeup_fd.h +++ b/src/core/iomgr/wakeup_fd_posix.h @@ -59,8 +59,8 @@ * 2. If the polling thread was awakened by a wakeup_fd event, call * grpc_wakeup_fd_consume_wakeup() on it. */ -#ifndef __GRPC_INTERNAL_IOMGR_WAKEUP_FD_H_ -#define __GRPC_INTERNAL_IOMGR_WAKEUP_FD_H_ +#ifndef __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ +#define __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ typedef struct grpc_wakeup_fd_info grpc_wakeup_fd_info; @@ -99,4 +99,4 @@ typedef struct grpc_wakeup_fd_vtable { * wakeup_fd_nospecial.c if no such implementation exists. */ extern const grpc_wakeup_fd_vtable specialized_wakeup_fd_vtable; -#endif /* __GRPC_INTERNAL_IOMGR_WAKEUP_FD_H_ */ +#endif /* __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ */ |