Boost named_semaphore ownerwship in shared library

I have a shared library where I created some functionality with semaphores. I am using boost::interprocess::named_semaphore with a thin wrapper around it. This library I am now linking dynamically with a small program.

The problem I am experiencing is that the semaphores are not deleted after I run my application. This problem only happens on Windows, on Linux the semaphores do get deleted. Now, I am calling boost::interprocess::named_semaphore::remove in the destructor of the wrapper I mentioned because the named_semaphore does not do that itself.

Also, if I call boost::interprocess::named_semaphore::remove directly in my application and not inside the library code the semaphore does get deleted! Strange!

Any ideas of what could be going wrong?

- - Source
comments powered by Disqus