Skip to content

测试了一下CTP的,好像OnRspQryInstrument返回的InstrumentField值有问题 #1

@liaom

Description

@liaom

iuaxl jfrnqk ol 784r1it

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是不是会产生死锁?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions