id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7923,Multiple consecutive named_mutex::remove,cbarrioy ,Ion Gaztañaga,"I have three named_mutex that need to be removed from system in the same inizialization function to ensure the unique existence of the named resources. The problem appear with multiple consecutive calls to named_mutex::remove with the three named_mutex, obtaining ""false"" return value randomly. I can see that named_mutex::remove use a temporal file and rename it with a name generated randomly, using process/system info data, however I obtain the same generated name in two consecutive calls and consequently remove method fails Maybe a precision issue with time used to construct the randomly generated name. I make a simple program to reproduce the problem. With this example you can obtain ""false"" sometimes in the first iteration, sometimes at iteration 11000, 23000, 90000... {{{ #include #include #include #include #include using namespace std; void sharedMemoryTest() { boost::scoped_ptr mutex; boost::scoped_ptr mutex2; std::string mutexName = ""ASYSTEM_00000_mutex""; std::string mutexName2 = ""ASYSTEM_00001_mutex""; bool error = false; int count = 0; while(!error) { try { mutex.reset(new boost::interprocess::named_mutex(boost::interprocess::create_only, mutexName.c_str())); error = error || !boost::interprocess::named_mutex::remove(mutexName.c_str()); mutex2.reset(new boost::interprocess::named_mutex(boost::interprocess::create_only, mutexName2.c_str())); error = error || !boost::interprocess::named_mutex::remove(mutexName2.c_str()); ++count; } catch(boost::interprocess::interprocess_exception& ie) { cout<<""Error ""<