Boost named_mutex and remove() command

From the boost docs, the remove call, is unnecessary. The destructor of named_mutex will automatically take care indicating to the OS that the process no longer needs the resource. You're probably fine with just relying upon the built-in behavior of the destructor for cleanup.

If you explicitly call remove, you'll likely cause any other processes or threads attempting to use the named mutex to fail on any operations on the mutex. Depending on how your usage is orchestrated, this could either cause data races or crashing/exceptions being thrown in other processes.

~named_mutex();

Destroys *this and indicates that the calling process is finished using the resource. The destructor function will deallocate any system resources allocated by the system for use by this process for this resource. The resource can still be opened again calling the open constructor overload. To erase the resource from the system use remove().