I am new in threading and classes, and trying to create a class. I have two member function in which one call the other using thread.
bool CSocket::StartCamera()
{
bool m_SendFlag;
m_SocketIn = socketInitialize(m_CameraIP, m_CameraPort);
if (m_SocketIn == INVALID_SOCKET)
return false;
m_SendFlag = sendCommand(m_SocketIn);
if (!m_SendFlag)
return false;
std::thread acquiringThread(&CSocket::callReceiveFxn, m_SocketIn);
acquiringThread.join();
}
and other member function is
void CSocket::callReceiveFxn(SOCKET socket)
{
unsigned char *m_frameBuffer = NULL;
while (true)
{
m_frameBuffer = receivePacket(socket);
m_ImageQ.Enqueue(m_frameBuffer, MAX_BYTE_PER_FRAME);
}
}
So my StartCamera
function call the callReceiveFxn
using thread.
But at std::thread acquiringThread(&CSocket::callReceiveFxn, m_SocketIn);
error occur that says
Error 3 error C2064: term does not evaluate to a function taking 1 arguments
So can anyone tell me why this error comes and please tell the solution for that