0

I have the following code where I am using lock_guard for a named mutex so that the mutex lock gets released when the execution of code is finished (including exceptions thrown)

#include <boost/interprocess/sync/named_mutex.hpp>
using namespace boost::interprocess;

int main()
{
    named_mutex mutex(open_or_create, "some_name");

    boost::lock_guard<named_mutex> guard(mutex);
    // Do other things
}

But the code hangs on the boost::lock_guard guard(mutex); and does not proceed to next line. Why?

whoami
  • 1,689
  • 3
  • 22
  • 45

0 Answers0