Original Post
I''m writing a small chat program with WinSock, and i was wondering if people ever use the volatile modifier. My code goes like this:
where "s_bListenThreadActive" is a volatile static BOOL. When the socket is closed, s_bListenThreadActive is set to FALSE, so the thread proc exits.
As i said, do people ever use the volatile keyword?
Cheers, Steve
Steve
DirectX Programmer
Soon to be the new Bill Gates
DWORD Socket::ListenThreadProc()
{
s_bListenThreadActive = TRUE;
while(s_bListenThreadActive)
{
}
return 0;
}
DirectX Programmer
Soon to be the new Bill Gates