aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-02-16 15:26:55 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-02-16 15:26:55 +0000
commita3bcd8f0260122d553918e9a33944ae414d32487 (patch)
treee7f32f2bcc4973b7fb1141f3b845695804f69528 /storage
parent5ef40769fbfca9725691685d95da51a3c946d25f (diff)
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