summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-02-16 16:44:30 +0100
committerGitHub <noreply@github.com>2022-02-16 16:44:30 +0100
commit1d37355c40b55874eb5f7a0c2e32afe9e9d2504f (patch)
treec2884ad2e5d1288ddad239e2ce360e1877888874 /storage
parent18d68e869c9f937ba5e9700517d5ae255ab89d4f (diff)
parenta3bcd8f0260122d553918e9a33944ae414d32487 (diff)
Merge pull request #21227 from vespa-engine/vekterli/fix-data-race-in-persistence-test-mock
Fix data race for persistence provider test mock
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/persistence/common/persistenceproviderwrapper.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/src/tests/persistence/common/persistenceproviderwrapper.h b/storage/src/tests/persistence/common/persistenceproviderwrapper.h
index 1552a955221..e0538fb7ca7 100644
--- a/storage/src/tests/persistence/common/persistenceproviderwrapper.h
+++ b/storage/src/tests/persistence/common/persistenceproviderwrapper.h
@@ -72,8 +72,14 @@ public:
/**
* Set a mask for operations to fail with _result
*/
- void setFailureMask(uint32_t mask) { _failureMask = mask; }
- uint32_t getFailureMask() const { return _failureMask; }
+ void setFailureMask(uint32_t mask) {
+ Guard guard(_lock);
+ _failureMask = mask;
+ }
+ uint32_t getFailureMask() const {
+ Guard guard(_lock);
+ return _failureMask;
+ }
/**
* Get a string representation of all the operations performed on the