📄 portque.cpp
字号:
#include "stdafx.h"
#include "PortQue.h"
CWzdMsg::CWzdMsg( int id,LPSTR pHdr, LPSTR pBody, int len, int error )
{
m_nID = id;
m_pHdr = pHdr;
m_pBody = pBody;
m_len = len;
m_error = error;
}
CWzdMsg::~CWzdMsg()
{
delete []m_pHdr;
delete []m_pBody;
}
//
// Add Message
//
void CWzdQueue::Add( CWzdMsg *pMsg )
{
CSingleLock slock( &m_mutex );
if ( slock.Lock( 1000 ) ) // timeout in milliseconds, default = INFINITE
{
AddTail(pMsg); // fifo
}
}
//
// Remove Message
//
CWzdMsg * CWzdQueue::Remove()
{
CSingleLock slock( &m_mutex );
if ( slock.Lock( 1000 ) ) // timeout in milliseconds, default = INFINITE
{
if ( !IsEmpty() )
return ( CWzdMsg* )RemoveHead();
}
return NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -