Fix a TSAN bug in lockfree_event

pull/16053/head
Yash Tibrewal 6 years ago
parent 31c7ab1aaf
commit 6b2b91cc93
  1. 6
      src/core/lib/iomgr/lockfree_event.cc

@ -89,7 +89,11 @@ void LockfreeEvent::DestroyEvent() {
void LockfreeEvent::NotifyOn(grpc_closure* closure) { void LockfreeEvent::NotifyOn(grpc_closure* closure) {
while (true) { while (true) {
gpr_atm curr = gpr_atm_no_barrier_load(&state_); /* This load needs to be an acquire load because this can be a shutdown
* error that we might need to reference. Adding acquire semantics makes
* sure that the shutdown error has been inited properly before us
* referencing it. */
gpr_atm curr = gpr_atm_acq_load(&state_);
if (grpc_polling_trace.enabled()) { if (grpc_polling_trace.enabled()) {
gpr_log(GPR_ERROR, "LockfreeEvent::NotifyOn: %p curr=%p closure=%p", this, gpr_log(GPR_ERROR, "LockfreeEvent::NotifyOn: %p curr=%p closure=%p", this,
(void*)curr, closure); (void*)curr, closure);

Loading…
Cancel
Save