2020-10-01 12:05:24 +02:00
|
|
|
#include "SharedLocalDataSet.h"
|
|
|
|
|
2021-03-10 23:16:47 +01:00
|
|
|
|
2020-10-01 12:05:24 +02:00
|
|
|
SharedLocalDataSet::SharedLocalDataSet(object_id_t objectId, sid_t sid,
|
|
|
|
const size_t maxSize): SystemObject(objectId),
|
|
|
|
LocalPoolDataSetBase(sid, nullptr, maxSize) {
|
|
|
|
this->setContainer(poolVarVector.data());
|
|
|
|
datasetLock = MutexFactory::instance()->createMutex();
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t SharedLocalDataSet::lockDataset(dur_millis_t mutexTimeout) {
|
|
|
|
return datasetLock->lockMutex(MutexIF::TimeoutType::WAITING, mutexTimeout);
|
|
|
|
}
|
|
|
|
|
2021-03-10 23:16:47 +01:00
|
|
|
SharedLocalDataSet::SharedLocalDataSet(object_id_t objectId,
|
|
|
|
HasLocalDataPoolIF *owner, uint32_t setId,
|
|
|
|
const size_t maxSize): SystemObject(objectId),
|
|
|
|
LocalPoolDataSetBase(owner, setId, nullptr, maxSize) {
|
|
|
|
this->setContainer(poolVarVector.data());
|
|
|
|
datasetLock = MutexFactory::instance()->createMutex();
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedLocalDataSet::~SharedLocalDataSet() {
|
|
|
|
MutexFactory::instance()->deleteMutex(datasetLock);
|
|
|
|
}
|
|
|
|
|
2020-10-01 12:05:24 +02:00
|
|
|
ReturnValue_t SharedLocalDataSet::unlockDataset() {
|
|
|
|
return datasetLock->unlockMutex();
|
|
|
|
}
|