finalyze moving

This commit is contained in:
2025-03-12 14:28:04 +03:00
parent f840006398
commit 033bbce220
774 changed files with 0 additions and 0 deletions

33
src/Server/checkUniq.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <boost/interprocess/sync/named_mutex.hpp>
using namespace boost::interprocess;
named_mutex* uniqInstance = NULL;
void __bst_create(const char* name)
{
try
{
uniqInstance = new named_mutex(open_or_create, name);
}
catch (interprocess_exception& e)
{
printf("ERROR %s\n", e.what());
}
if (uniqInstance == NULL)
exit(-22);
}
bool __bst_tryToLock()
{
if (uniqInstance)
return uniqInstance->try_lock();
else
return true;
}
void __bst_unlock()
{
if (uniqInstance)
uniqInstance->unlock();
}