lock transactions: fix non-transactional writes
Lock transactions were actually writing *after* the lock was released. The code was looking at the result of `release_write()` before writing, then writing based on whether the lock was released. This is pretty obviously wrong. - [x] Refactor `Lock` so that a release function can be passed to the `Lock` and called *only* when a lock is really released. - [x] Refactor `LockTransaction` classes to use the release function instead of checking the return value of `release_read()` / `release_write()`
Showing
- lib/spack/llnl/util/lock.py 68 additions, 32 deletionslib/spack/llnl/util/lock.py
- lib/spack/spack/database.py 4 additions, 3 deletionslib/spack/spack/database.py
- lib/spack/spack/test/llnl/util/lock.py 205 additions, 135 deletionslib/spack/spack/test/llnl/util/lock.py
- lib/spack/spack/util/file_cache.py 8 additions, 2 deletionslib/spack/spack/util/file_cache.py
Loading
Please register or sign in to comment