diff options
Diffstat (limited to 'src/core/lib/iomgr/lockfree_event.cc')
-rw-r--r-- | src/core/lib/iomgr/lockfree_event.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index f0e798e8d8..7b194e3db5 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -85,7 +85,7 @@ void LockfreeEvent::DestroyEvent() { kShutdownBit /* shutdown, no error */)); } -void LockfreeEvent::NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure) { +void LockfreeEvent::NotifyOn(grpc_closure* closure) { while (true) { gpr_atm curr = gpr_atm_no_barrier_load(&state_); if (grpc_polling_trace.enabled()) { @@ -118,7 +118,7 @@ void LockfreeEvent::NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure) { closure when transitioning out of CLOSURE_NO_READY state (i.e there is no other code that needs to 'happen-after' this) */ if (gpr_atm_no_barrier_cas(&state_, kClosureReady, kClosureNotReady)) { - GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_NONE); + GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_NONE); return; /* Successful. Return */ } @@ -131,7 +131,7 @@ void LockfreeEvent::NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure) { schedule the closure with the shutdown error */ if ((curr & kShutdownBit) > 0) { grpc_error* shutdown_err = (grpc_error*)(curr & ~kShutdownBit); - GRPC_CLOSURE_SCHED(exec_ctx, closure, + GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( "FD Shutdown", &shutdown_err, 1)); return; @@ -149,8 +149,7 @@ void LockfreeEvent::NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure) { GPR_UNREACHABLE_CODE(return ); } -bool LockfreeEvent::SetShutdown(grpc_exec_ctx* exec_ctx, - grpc_error* shutdown_err) { +bool LockfreeEvent::SetShutdown(grpc_error* shutdown_err) { gpr_atm new_state = (gpr_atm)shutdown_err | kShutdownBit; while (true) { @@ -184,7 +183,7 @@ bool LockfreeEvent::SetShutdown(grpc_exec_ctx* exec_ctx, happens-after on that edge), and a release to pair with anything loading the shutdown state. */ if (gpr_atm_full_cas(&state_, curr, new_state)) { - GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)curr, + GRPC_CLOSURE_SCHED((grpc_closure*)curr, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( "FD Shutdown", &shutdown_err, 1)); return true; @@ -200,7 +199,7 @@ bool LockfreeEvent::SetShutdown(grpc_exec_ctx* exec_ctx, GPR_UNREACHABLE_CODE(return false); } -void LockfreeEvent::SetReady(grpc_exec_ctx* exec_ctx) { +void LockfreeEvent::SetReady() { while (true) { gpr_atm curr = gpr_atm_no_barrier_load(&state_); @@ -234,7 +233,7 @@ void LockfreeEvent::SetReady(grpc_exec_ctx* exec_ctx) { spurious set_ready; release pairs with this or the acquire in notify_on (or set_shutdown) */ else if (gpr_atm_full_cas(&state_, curr, kClosureNotReady)) { - GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)curr, GRPC_ERROR_NONE); + GRPC_CLOSURE_SCHED((grpc_closure*)curr, GRPC_ERROR_NONE); return; } /* else the state changed again (only possible by either a racing |