diff --git a/ParallelAccessStore.h b/ParallelAccessStore.h index 5fee8445..bcaba4ef 100644 --- a/ParallelAccessStore.h +++ b/ParallelAccessStore.h @@ -10,6 +10,7 @@ #include #include #include "ParallelAccessBaseStore.h" +#include //TODO Refactor @@ -102,7 +103,7 @@ cpputils::unique_ref ParallelAccessStore cpputils::unique_ref ParallelAccessStore::_add(const Key &key, cpputils::unique_ref resource) { auto insertResult = _openResources.emplace(key, std::move(resource)); - assert(true == insertResult.second); + ASSERT(true == insertResult.second, "Inserting failed"); return _createResourceRef(insertResult.first->second.getReference(), key); } @@ -132,7 +133,7 @@ boost::optional> ParallelAccessStore void ParallelAccessStore::remove(const Key &key, cpputils::unique_ref resource) { auto insertResult = _resourcesToRemove.emplace(key, std::promise>()); - assert(true == insertResult.second); + ASSERT(true == insertResult.second, "Inserting failed"); cpputils::destruct(std::move(resource)); //Wait for last resource user to release it @@ -146,7 +147,7 @@ template void ParallelAccessStore::release(const Key &key) { std::lock_guard lock(_mutex); auto found = _openResources.find(key); - assert (found != _openResources.end()); + ASSERT(found != _openResources.end(), "Didn't find key"); found->second.releaseReference(); if (found->second.refCountIsZero()) { auto foundToRemove = _resourcesToRemove.find(key);