Recover from stale mutexes with force unlocking and retry
This commit is contained in:
committed by
Patrick Niklaus
parent
caa7c994a0
commit
81c5cba0e5
@@ -19,11 +19,23 @@ struct SharedBarriers
|
||||
{
|
||||
}
|
||||
|
||||
static void resetCurrentRegions()
|
||||
{
|
||||
boost::interprocess::named_sharable_mutex::remove("current_regions");
|
||||
}
|
||||
static void resetRegions1()
|
||||
{
|
||||
boost::interprocess::named_sharable_mutex::remove("regions_1");
|
||||
}
|
||||
static void resetRegions2()
|
||||
{
|
||||
boost::interprocess::named_sharable_mutex::remove("regions_2");
|
||||
}
|
||||
|
||||
boost::interprocess::named_upgradable_mutex current_regions_mutex;
|
||||
boost::interprocess::named_sharable_mutex regions_1_mutex;
|
||||
boost::interprocess::named_sharable_mutex regions_2_mutex;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,15 @@ class Storage
|
||||
{
|
||||
public:
|
||||
Storage(StorageConfig config);
|
||||
int Run();
|
||||
|
||||
enum ReturnCode
|
||||
{
|
||||
Ok,
|
||||
Error,
|
||||
Retry
|
||||
};
|
||||
|
||||
ReturnCode Run(int max_wait);
|
||||
|
||||
private:
|
||||
StorageConfig config;
|
||||
|
||||
Reference in New Issue
Block a user