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