fixed receiver deadlock bug in hdf5 file writing

This commit is contained in:
muelle_m1 authored and Dhanya Thattil committed 2026-11-13 17:04:32 +01:00
1 parent 61dcc96a2e
commit 9dc38f9053
1 file changed
+3 -2
+3 -2
View File
@@ -136,7 +136,7 @@ void HDF5DataFile::CreateFile() {
'_' + std::to_string(fileIndex) + ".h5");
fileName = p.string();
std::lock_guard<std::mutex> lock(*hdf5Lib);
std::unique_lock<std::mutex> lock(*hdf5Lib);
uint64_t framestosave =
((maxFramesPerFile == 0) ? numImages : // infinite images
@@ -207,8 +207,9 @@ void HDF5DataFile::CreateFile() {
}
} catch (const H5::Exception &error) {
error.printErrorStack();
lock.unlock(); // CloseFile() also wants the mutex --> need to unlock here
CloseFile();
throw RuntimeError("Could not create HDF5 handles in object " + index);
throw RuntimeError("Could not create HDF5 handles in object " + std::to_string(index));
}
if (!silentMode) {
LOG(logINFO) << "[" << udpPortNumber