diff options
author | Craig Tiller <ctiller@google.com> | 2016-03-02 22:17:24 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-03-02 22:34:23 -0800 |
commit | 0cb803d9ca4286601e9e6a3240cfa3488b662b7c (patch) | |
tree | 9c5000567bd52328ed9827c9e2e5a8c671d94158 /include | |
parent | bfc8a8d0496c1e505815772b623760a2ecf1e4d0 (diff) |
Always ref writable streams
We suffered a bug whereby doing a follow-up write to another write could
resurrect a deleted stream, causing all sorts of crash.
Fix: when a stream becomes writable (vs when we start writing) take a
ref on the stream, and only relinquish it once we're done writing.
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/impl/codegen/sync.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/sync.h b/include/grpc/impl/codegen/sync.h index d2f19d37d6..6fd7d64b29 100644 --- a/include/grpc/impl/codegen/sync.h +++ b/include/grpc/impl/codegen/sync.h @@ -182,6 +182,10 @@ GPRAPI void gpr_ref_init(gpr_refcount *r, int n); /* Increment the reference count *r. Requires *r initialized. */ GPRAPI void gpr_ref(gpr_refcount *r); +/* Increment the reference count *r. Requires *r initialized. + Crashes if refcount is zero */ +GPRAPI void gpr_ref_non_zero(gpr_refcount *r); + /* Increment the reference count *r by n. Requires *r initialized, n > 0. */ GPRAPI void gpr_refn(gpr_refcount *r, int n); |