I am writing code in which a UI thread should interact with a background thread that is performing network communication. The code works, but will it be considered thread safe?
I would feel much better if someone experienced could lead me to the right path on this ...
static Mutex^ mut_currentPage = gcnew Mutex;
static array<unsigned char>^ m_currentPage;
property array<unsigned char>^ Write
{
void set(array<unsigned char>^ value)
{
mut_currentPage->WaitOne();
m_currentPage = value;
mut_currentPage->ReleaseMutex();
}
}
This is .NET C ++ code ... :)
rozon source
share