aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/lockfree_event.h
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-04-02 18:55:48 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2018-04-02 19:20:34 -0700
commita324bd5a35eb7ba94f287dce84f3434dd2f3ef39 (patch)
tree2985cb7a6dccc8091e106805fb4ed040b650f491 /src/core/lib/iomgr/lockfree_event.h
parent0b49467404b997c591ce64a476c6ecfdee085316 (diff)
Add documentation for lockfree_event.h
Diffstat (limited to 'src/core/lib/iomgr/lockfree_event.h')
-rw-r--r--src/core/lib/iomgr/lockfree_event.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h
index b507b94648..d6a6c226bc 100644
--- a/src/core/lib/iomgr/lockfree_event.h
+++ b/src/core/lib/iomgr/lockfree_event.h
@@ -42,12 +42,23 @@ class LockfreeEvent {
void InitEvent();
void DestroyEvent();
+ // Returns true if fd has been shutdown, false otherwise.
bool IsShutdown() const {
return (gpr_atm_no_barrier_load(&state_) & kShutdownBit) != 0;
}
+ // Schedules \a closure when the event is received (see SetReady()) or the
+ // shutdown state has been set. Note that the event may have already been
+ // received, in which case the closure would be scheduled immediately.
+ // If the shutdown state has already been set, then \a closure is scheduled
+ // with the shutdown error.
void NotifyOn(grpc_closure* closure);
+
+ // Sets the shutdown state. If a closure had been provided by NotifyOn and has
+ // not yet been scheduled, it will be scheduled with \a error.
bool SetShutdown(grpc_error* error);
+
+ // Signals that the event has been received.
void SetReady();
private: