diff --git a/src/trader/ctp_trader.cpp b/src/trader/ctp_trader.cpp index 3734744530b6758970e2684e545ce15a9a649e30..5b906f2786b0e8f6cf780bb86a40bc5b6d085e85 100644 --- a/src/trader/ctp_trader.cpp +++ b/src/trader/ctp_trader.cpp @@ -1,4 +1,4 @@ -#include "ctp_trader.h" +#include "ctp_trader.h" #include #include @@ -373,8 +373,8 @@ void ctp_trader::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingA if (bIsLast && _is_sync_wait) { print_position("OnRspQryInvestorPosition"); + while (!_is_sync_wait.exchange(false)); _process_signal.notify_all(); - while (!_is_sync_wait.exchange(false)); } } @@ -483,8 +483,8 @@ void ctp_trader::OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInve if (bIsLast && _is_sync_wait) { print_position("OnRspQryInvestorPosition"); - _process_signal.notify_all(); - while (!_is_sync_wait.exchange(false)); + while (!_is_sync_wait.exchange(false)); + _process_signal.notify_all(); } } @@ -503,8 +503,8 @@ void ctp_trader::OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoFi if (bIsLast && _is_sync_wait) { print_position("OnRspQryTrade"); - _process_signal.notify_all(); - while (!_is_sync_wait.exchange(false)); + while (!_is_sync_wait.exchange(false)); + _process_signal.notify_all(); } } @@ -534,8 +534,8 @@ void ctp_trader::OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoFi if (bIsLast && _is_sync_wait) { print_position("OnRspQryTrade"); - _process_signal.notify_all(); - while (!_is_sync_wait.exchange(false)); + while (!_is_sync_wait.exchange(false)); + _process_signal.notify_all(); } }