add lock context for pool manager
This commit is contained in:
parent
f84097543e
commit
245886c555
@ -10,7 +10,7 @@ PoolManager::PoolManager(object_id_t setObjectId, const LocalPoolConfig& localPo
|
|||||||
PoolManager::~PoolManager() { MutexFactory::instance()->deleteMutex(mutex); }
|
PoolManager::~PoolManager() { MutexFactory::instance()->deleteMutex(mutex); }
|
||||||
|
|
||||||
ReturnValue_t PoolManager::reserveSpace(const size_t size, store_address_t* address) {
|
ReturnValue_t PoolManager::reserveSpace(const size_t size, store_address_t* address) {
|
||||||
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, mutexTimeoutMs);
|
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, mutexTimeoutMs, LOCK_CTX);
|
||||||
ReturnValue_t status = LocalPool::reserveSpace(size, address);
|
ReturnValue_t status = LocalPool::reserveSpace(size, address);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -22,12 +22,12 @@ ReturnValue_t PoolManager::deleteData(store_address_t storeId) {
|
|||||||
<< storeId.poolIndex << ". id is " << storeId.packetIndex << std::endl;
|
<< storeId.poolIndex << ". id is " << storeId.packetIndex << std::endl;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, mutexTimeoutMs);
|
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, mutexTimeoutMs, LOCK_CTX);
|
||||||
return LocalPool::deleteData(storeId);
|
return LocalPool::deleteData(storeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PoolManager::deleteData(uint8_t* buffer, size_t size, store_address_t* storeId) {
|
ReturnValue_t PoolManager::deleteData(uint8_t* buffer, size_t size, store_address_t* storeId) {
|
||||||
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, 20);
|
MutexGuard mutexHelper(mutex, MutexIF::TimeoutType::WAITING, mutexTimeoutMs, LOCK_CTX);
|
||||||
ReturnValue_t status = LocalPool::deleteData(buffer, size, storeId);
|
ReturnValue_t status = LocalPool::deleteData(buffer, size, storeId);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ class PoolManager : public LocalPool {
|
|||||||
protected:
|
protected:
|
||||||
//! Default mutex timeout value to prevent permanent blocking.
|
//! Default mutex timeout value to prevent permanent blocking.
|
||||||
uint32_t mutexTimeoutMs = 20;
|
uint32_t mutexTimeoutMs = 20;
|
||||||
|
static constexpr char LOCK_CTX[] = "PoolManager";
|
||||||
|
|
||||||
ReturnValue_t reserveSpace(size_t size, store_address_t* address) override;
|
ReturnValue_t reserveSpace(size_t size, store_address_t* address) override;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user