CatalogTask
Every task that touches the StudyCatalog, serialized against every other one.
| Inherits | OpalTask |
In the namespace study::opal. Declared in src/libs/libstudy/study/opal/StudyTasks.hpp.
Detailed description
⚠ **`OpalTask::execute` runs on a BACKGROUND thread** — the runtime creates one per plan (`OpalTaskRuntime.cpp`), so two plans can be in flight at once. `StudyCatalog::study()` hands out a pointer into a `QMap`, and a second plan inserting a study while the first holds that pointer would invalidate it.
The runtime already has the mechanism: it acquires every task's `resourceScopes()` for the whole plan before starting it, and releases them at the end. One shared scope across both families therefore makes the catalog single-writer without a lock the callers have to remember.
The mutex inside `StudyCatalog` stays. It covers the interface thread, which does not go through the runtime at all.