-
- Downloads
runtime: Fix locking behaviour in variable directory
We need to hold an exclusive lock while carrying out GC, because any
number of processes could be trying to create temporary copies there
at the same time, and if that's happening then it's unsafe for the
GC pass to be looking at the temporary copies concurrently. Only do
the GC pass opportunistically, if we can get an exclusive lock without
waiting.
Conversely, while we're creating the temporary copies, we continue to
take out a non-exclusive lock; but if another process is in the middle
of a GC pass, we want to wait for it instead of just failing.
Signed-off-by:
Simon McVittie <smcv@collabora.com>
parent
4038d0e7
No related branches found
No related tags found
Loading
Please register or sign in to comment