Skip to content
Snippets Groups Projects
Commit a2a8fbb4 authored by Jan H. K. Timm's avatar Jan H. K. Timm
Browse files

DeviceModule rocovery list and mutex

  - add list with shared ptr of transferElements for recovery write
  - add shared mutex
parent ac0ca012
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,8 @@ namespace ChimeraTK {
* to the device. */
std::list<boost::shared_ptr<TransferElement>> writeAfterOpen;
std::list<boost::shared_ptr<TransferElement>> writeRecoveryOpen;
Application* owner{nullptr};
mutable bool deviceIsInitialized = false;
......
......@@ -294,6 +294,8 @@ namespace ChimeraTK {
}
for(auto& te : writeAfterOpen) {
te->write();
// addRecoveryAccessor(te);
}
}
catch(ChimeraTK::runtime_error& e) {
......@@ -370,6 +372,12 @@ namespace ChimeraTK {
for(auto& te : writeAfterOpen) {
te->write();
}
{
boost::unique_lock<boost::shared_mutex> uniiqueLock(recoverySharedMutex);
for(auto& te : writeRecoveryOpen) {
te->write();
}
}
}
catch(ChimeraTK::runtime_error& e) {
// Report the error. This puts the exception to the queue and we can continue with waiting for the queue.
......@@ -468,7 +476,7 @@ namespace ChimeraTK {
void DeviceModule::notify() { errorIsResolvedCondVar.notify_all(); }
void DeviceModule::addRecoveryAccessor(boost::shared_ptr<TransferElement> recoveryAccessor) {
std::cout << "DeviceModule::addRecoveryAccessor:: Implement me" << std::endl;
writeRecoveryOpen.push_back(recoveryAccessor);
}
boost::shared_lock<boost::shared_mutex> DeviceModule::getRecoverySharedLock() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment