Skip to content
Snippets Groups Projects
Commit 059382ab authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[container] fix deadlock

The problem was a locked method calling backend(), thus calling
ensure_uniqueness(), which in turn waited for a lock. The solution is to
first ensure uniqueness and obtain, then lock, then use a reference on the
unique backend. This is in general acchieved by
```
auto& backend_ref = backend(); // calles ensure_uniqueness()
std::lock...
// work with backend_ref
```

To make it a bit more explicit what is going on we could also let
ensure_uniqueness() return a `BackendType&` and use that instead of
backend().
parent 8c51edf6
No related branches found
No related tags found
No related merge requests found
Loading
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