Skip to content

Instantly share code, notes, and snippets.

@eventhelix
Created March 10, 2015 01:56
Show Gist options
  • Save eventhelix/d699f9141996875dd159 to your computer and use it in GitHub Desktop.
Save eventhelix/d699f9141996875dd159 to your computer and use it in GitHub Desktop.
class DSP
{
public:
void WriteBuffer(Buffer *pBuf);
Buffer *ReadBuffer();
};
Status MessageHandler::SendMessage(Buffer *)
{
int dspId = pBuffer->GetDSP();
pDSP = m_dsp[dspId];
int status = pDSP->WriteBuffer();
return status;
}
Status DSP::WriteBuffer(Buffer *)
{
int status = m_pQueue->Add(pBuffer);
IOWrite(WRITTEN_MESSAGE);
if (m_pQueue->GetLength() > CONGESTION_THRESHOLD)
{
m_bCongestionFlag = true;
}
return status;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment