Skip to content
Commit 80aab523 authored by Milian Wolff's avatar Milian Wolff
Browse files

Refactor ItemRepository code to make it work without recursive mutex

While the IndexedString used a repository with a non-recursive mutex,
this was not a setup that worked in general: removing an item e.g.
would deadlock in such a scenario. IndexedString got lucky because
it never tries to delete anything from the repository...

Refactor the code as follows:

The bulk of what was ItemRepository is now ItemRepositoryPrivate
and assumes that it gets accessed with external serialization.

The new ItemRepository is just a shim around that Private but it
provides the serialization by using the ThisLocker as before.

This way, the Private class can call its own API in any way it wants
and we don't run into a situation where we would accidentally deadlock
by relocking a non-recursive mutex.

For now, only the tests are using the non-recursive mutex now. Other
repositories will be ported one-by-one now.
parent f89ce6f3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment