
test_CTP_Main里面添加
api.OnRspQryInstrument = OnRspQryInstrument;和
api.ReqQryInstrument("","");
打出来的InstrumentName全是交易所代码,InstrumentID全是日期
又测试了一下其他命令,好像C++返回的struct到了C#里都有问题。
另外
MsgQueue.cpp里面
void CMsgQueue::StopThread()
{
//m_mtx.lock();
m_bRunning = false;
lock_guard<mutex> cl(m_mtx);
if(m_hThread)
{
m_hThread->join();
delete m_hThread;
m_hThread = nullptr;
}
//m_mtx.unlock();
}
和
void CMsgQueue::RunInThread()
{
while (m_bRunning)
{
if (Process())
{
}
else
{
//挂起,等事件到来
//m_mtx.lock();
this_thread::sleep_for(chrono::milliseconds(1));
}
}
lock_guard<mutex> cl(m_mtx);
// 清理线程
m_hThread = nullptr;
m_bRunning = false;
}
的两个lock_guard是不是会产生死锁?