What I need is something like std::map<std::string, CCriticalSection>
but CCriticalSection is non-copyable. Instead of CCriticalSection
I thought I could use CRICITAL_SECTION
but it's also not possible to copy or move objects of this type. Because it's a very old project, I'm restricted to use MFC and VC6. I would like to access the synchronization objects in following manner (the following code does not work and is just an idea how I would like to use the dicionary):
// global variable
std::map<std::string, CCriticalSection> csec;
unsigned int somefunc(std::string ip)
{
CSingleLock lock(&csec[ip], TRUE);
// do something
}
So my question is, how to make a dictionary of synchronization objects using MFC and VC6?
Thank you for your answers!