aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2018-01-30 22:25:46 +0100
committerGravatar GitHub <noreply@github.com>2018-01-30 22:25:46 +0100
commit486a619af2e25bff9de034eb2888fb9fcdeedff4 (patch)
treed8a3578b0107519c1f80f9a9f13731dc18a3a635
parent1952018a02a34fd6334921be26492985ed64afe3 (diff)
parent8376749faa4a2fdaaeabeb318b12b3aa6058f300 (diff)
Merge pull request #14233 from jtattermusch/settings_timeout_test_race
Tentative fix for EventState::done() data race
-rw-r--r--test/core/transport/chttp2/settings_timeout_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/core/transport/chttp2/settings_timeout_test.cc b/test/core/transport/chttp2/settings_timeout_test.cc
index d7d6ee7508..7fb395d4b6 100644
--- a/test/core/transport/chttp2/settings_timeout_test.cc
+++ b/test/core/transport/chttp2/settings_timeout_test.cc
@@ -169,7 +169,7 @@ class Client {
grpc_closure* closure() { return &closure_; }
- bool done() const { return done_; }
+ bool done() const { return gpr_atm_acq_load(&done_atm_) != 0; }
// Caller does NOT take ownership of the error.
grpc_error* error() const { return error_; }
@@ -179,11 +179,11 @@ class Client {
gpr_log(GPR_INFO, "OnEventDone(): %s", grpc_error_string(error));
EventState* state = (EventState*)arg;
state->error_ = GRPC_ERROR_REF(error);
- state->done_ = true;
+ gpr_atm_rel_store(&state->done_atm_, 1);
}
grpc_closure closure_;
- bool done_ = false;
+ gpr_atm done_atm_ = 0;
grpc_error* error_ = GRPC_ERROR_NONE;
};