|
|
|
@ -231,13 +231,15 @@ void ClientCall::StartCall(const grpc_op& send_initial_metadata_op) { |
|
|
|
|
auto call = MakeCallPair(std::move(send_initial_metadata_), event_engine(), |
|
|
|
|
arena()->Ref()); |
|
|
|
|
started_call_initiator_ = std::move(call.initiator); |
|
|
|
|
call_destination_->StartCall(std::move(call.handler)); |
|
|
|
|
while (true) { |
|
|
|
|
GRPC_TRACE_LOG(call, INFO) |
|
|
|
|
<< DebugTag() << "StartCall " << GRPC_DUMP_ARGS(cur_state); |
|
|
|
|
switch (cur_state) { |
|
|
|
|
case kUnstarted: |
|
|
|
|
if (call_state_.compare_exchange_strong(cur_state, kStarted, |
|
|
|
|
std::memory_order_acq_rel, |
|
|
|
|
std::memory_order_acquire)) { |
|
|
|
|
call_destination_->StartCall(std::move(call.handler)); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
@ -249,6 +251,7 @@ void ClientCall::StartCall(const grpc_op& send_initial_metadata_op) { |
|
|
|
|
if (call_state_.compare_exchange_strong(cur_state, kStarted, |
|
|
|
|
std::memory_order_acq_rel, |
|
|
|
|
std::memory_order_acquire)) { |
|
|
|
|
call_destination_->StartCall(std::move(call.handler)); |
|
|
|
|
auto unordered_start = reinterpret_cast<UnorderedStart*>(cur_state); |
|
|
|
|
while (unordered_start->next != nullptr) { |
|
|
|
|
unordered_start->start_pending_batch(); |
|
|
|
|