Commit e7649d8f authored by Remi Mommsen's avatar Remi Mommsen Committed by Remi Mommsen
Browse files

references #144: all users must be able to get the semaphore

parent 8e016a1e
#ifndef _evb_StateMachine_h_
#define _evb_StateMachine_h_
#include <boost/interprocess/permissions.hpp>
#include <boost/interprocess/sync/named_semaphore.hpp>
#include <boost/statechart/event_base.hpp>
#include <boost/statechart/state.hpp>
......@@ -349,7 +350,9 @@ void evb::EvBStateMachine<MostDerived,InitialState>::updateMonitoringItems()
template <class MostDerived,class InitialState>
void evb::EvBStateMachine<MostDerived,InitialState>::acquireLock(const std::string& name)
{
boost::interprocess::named_semaphore semaphore(boost::interprocess::open_or_create,name.c_str(),1);
boost::interprocess::permissions permissions;
permissions.set_unrestricted();
boost::interprocess::named_semaphore semaphore(boost::interprocess::open_or_create,name.c_str(),1,permissions);
if ( haveLock_ || semaphore.try_wait() )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment