aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/wakeup_fd_pipe.c
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2016-08-06 21:27:29 -0700
committerGravatar Ken Payson <kpayson@google.com>2016-09-14 14:25:46 -0700
commit31caabdead52000354c4fdd88b68bb3041ca8c4a (patch)
tree67ec849190f0211b15c506397fbc78201b44d29b /src/core/lib/iomgr/wakeup_fd_pipe.c
parent93b09478f0264f62e577b215dea7bc908abc6b98 (diff)
Add shim to support condition variable wakeup fds where pipe/eventfd is not available
Diffstat (limited to 'src/core/lib/iomgr/wakeup_fd_pipe.c')
-rw-r--r--src/core/lib/iomgr/wakeup_fd_pipe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.c b/src/core/lib/iomgr/wakeup_fd_pipe.c
index 4e5dbdcb73..3dc94c94ba 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.c
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.c
@@ -95,8 +95,13 @@ static void pipe_destroy(grpc_wakeup_fd* fd_info) {
}
static int pipe_check_availability(void) {
- /* Assume that pipes are always available. */
- return 1;
+ grpc_wakeup_fd fd;
+ if (pipe_init(&fd) == GRPC_ERROR_NONE) {
+ pipe_destroy(&fd);
+ return 1;
+ } else {
+ return 0;
+ }
}
const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable = {