Re: Is this thread-safe?
"Jack" <jl@knight.com> wrote in message
news:#u0#pE0EKHA.1540@TK2MSFTNGP04.phx.gbl...
Hi guys
[code]
unsigned int __stdcall cDisplay_Thread::Manage_Display(void *arg)
{
OutputDebugString("CDisplay_Thread::Manage_Display\n");
CDemoView *v = (CDemoView*) arg;
while(true)
{
if (v->GetDocument()->m_strRecv.GetLength() != 0)
{
v->UpdateData(FALSE);
}
}
return 0;
}
[/code]
Is this code snippet above thread safe?
Is your CDemoView object or its associated document modified from any other
thread? If it is, then this code is not safe.
This crashes on v->UpdateData(FALSE); (Doing DataExchange)
v is CFormView
The GetDocument function above it just works fine..
I tried to declare a member variable in cDisplay_Thread::Manage_Display,
but I can't keep it persistant.... Any comments?
Thanks
Jack
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4298 (20090802) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4298 (20090802) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com