Remove locks

This commit is contained in:
2026-04-24 17:10:29 +10:00
parent 7a11c9617b
commit 3a527d2dad
51 changed files with 38 additions and 1251 deletions

View File

@@ -3,15 +3,6 @@
namespace ANSCENTER {
bool ANSRETINAFD::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
// Serialize derived init against concurrent extract re-entries on the
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
ModelFolderLockGuard _flg(_modelFolder, "ANSRETINAFD::Initialize");
if (!_flg.acquired()) {
this->_logger.LogError("ANSRETINAFD::Initialize",
"Timed out waiting for model-folder lock: " + _modelFolder,
__FILE__, __LINE__);
return false;
}
// We do not need to check for the license
_licenseValid = true;
if (!_licenseValid) return false;
@@ -70,15 +61,6 @@ namespace ANSCENTER {
// We need to get the _modelFolder
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
if (!result) return false;
// Serialize derived init against concurrent extract re-entries on the
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
ModelFolderLockGuard _flg(_modelFolder, "ANSRETINAFD::LoadModel");
if (!_flg.acquired()) {
this->_logger.LogError("ANSRETINAFD::LoadModel",
"Timed out waiting for model-folder lock: " + _modelFolder,
__FILE__, __LINE__);
return false;
}
// We need to get the modelfolder from here
std::string onnxfile = CreateFilePath(_modelFolder, "retinaface.onnx");
@@ -270,7 +252,6 @@ namespace ANSCENTER {
}
}
ANSRETINAFD::~ANSRETINAFD() {
try {
// if (_faceDectector) {