diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-08-13 22:41:33 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-08-13 22:53:21 +0200 |
commit | bb3aed0ef9dd41849e50faec1c83e67948e30adc (patch) | |
tree | a328dd7c00514aa351949779bb2745a8b16f84bc /include | |
parent | 118f65dc8c5df39872aff5f6bf269b16ce82c259 (diff) |
Removing gpr_cancelable.
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/support/cancellable_platform.h | 56 | ||||
-rw-r--r-- | include/grpc/support/sync.h | 33 |
2 files changed, 0 insertions, 89 deletions
diff --git a/include/grpc/support/cancellable_platform.h b/include/grpc/support/cancellable_platform.h deleted file mode 100644 index e8e4b84e2f..0000000000 --- a/include/grpc/support/cancellable_platform.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * 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_SUPPORT_CANCELLABLE_PLATFORM_H -#define GRPC_SUPPORT_CANCELLABLE_PLATFORM_H - -#include <grpc/support/atm.h> -#include <grpc/support/sync.h> - -struct gpr_cancellable_list_ { - /* a doubly-linked list on cancellable's waiters queue */ - struct gpr_cancellable_list_ *next; - struct gpr_cancellable_list_ *prev; - /* The following two fields are arguments to gpr_cv_cancellable_wait() */ - gpr_mu *mu; - gpr_cv *cv; -}; - -/* Internal definition of gpr_cancellable. */ -typedef struct { - gpr_mu mu; /* protects waiters and modifications to cancelled */ - gpr_atm cancelled; - struct gpr_cancellable_list_ waiters; -} gpr_cancellable; - -#endif /* GRPC_SUPPORT_CANCELLABLE_PLATFORM_H */ diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h index 1cdde1d2d0..1dd826a828 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -65,7 +65,6 @@ #endif #include <grpc/support/time.h> /* for gpr_timespec */ -#include <grpc/support/cancellable_platform.h> #ifdef __cplusplus extern "C" { @@ -121,11 +120,6 @@ void gpr_cv_destroy(gpr_cv *cv); holds an exclusive lock on *mu. */ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline); -/* Behave like gpr_cv_wait(cv, mu, abs_deadline), except behave as though - the deadline has expired if *c is cancelled. */ -int gpr_cv_cancellable_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline, - gpr_cancellable *c); - /* If any threads are waiting on *cv, wake at least one. Clients may treat this as an optimization of gpr_cv_broadcast() for use in the case where waking more than one waiter is not useful. @@ -135,28 +129,6 @@ void gpr_cv_signal(gpr_cv *cv); /* Wake all threads waiting on *cv. Requires: *cv initialized. */ void gpr_cv_broadcast(gpr_cv *cv); -/* --- Cancellation --- - A gpr_cancellable can be used with gpr_cv_cancellable_wait() - or gpr_event_cancellable_wait() cancel pending waits. */ - -/* Initialize *c. */ -void gpr_cancellable_init(gpr_cancellable *c); - -/* Cause *c no longer to be initialized, freeing any memory in use. Requires: - *c initialized; no other concurrent operation on *c. */ -void gpr_cancellable_destroy(gpr_cancellable *c); - -/* Return non-zero iff *c has been cancelled. Requires *c initialized. - This call is faster than acquiring a mutex on most platforms. */ -int gpr_cancellable_is_cancelled(gpr_cancellable *c); - -/* Cancel *c. If *c was not previously cancelled, cause - gpr_cancellable_init() to return non-zero, and outstanding and future - calls to gpr_cv_cancellable_wait() and gpr_event_cancellable_wait() to - return immediately indicating a timeout has occurred; otherwise do nothing. - Requires *c initialized.*/ -void gpr_cancellable_cancel(gpr_cancellable *c); - /* --- One-time initialization --- gpr_once must be declared with static storage class, and initialized with @@ -199,11 +171,6 @@ void *gpr_event_get(gpr_event *ev); on most platforms. */ void *gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline); -/* Behave like gpr_event_wait(ev, abs_deadline), except behave as though - the deadline has expired if *c is cancelled. */ -void *gpr_event_cancellable_wait(gpr_event *ev, gpr_timespec abs_deadline, - gpr_cancellable *c); - /* --- Reference counting --- These calls act on the type gpr_refcount. It requires no destruction. */ |