@@ -86,14 +86,15 @@ struct PLDHashEntryHdr {
86
86
//
87
87
class Checker {
88
88
public:
89
- constexpr Checker () : mState(kIdle ), mIsWritable(1 ) {}
89
+ constexpr Checker () : mState(kIdle ), mIsWritable(true ) {}
90
90
91
91
Checker& operator =(Checker&& aOther) {
92
92
// Atomic<> doesn't have an |operator=(Atomic<>&&)|.
93
93
mState = uint32_t (aOther.mState );
94
- mIsWritable = uint32_t (aOther.mIsWritable );
94
+ mIsWritable = bool (aOther.mIsWritable );
95
95
96
96
aOther.mState = kIdle ;
97
+ // XXX Shouldn't we set mIsWritable to true here for consistency?
97
98
98
99
return *this ;
99
100
}
@@ -107,9 +108,9 @@ class Checker {
107
108
108
109
bool IsIdle () const { return mState == kIdle ; }
109
110
110
- bool IsWritable () const { return !! mIsWritable ; }
111
+ bool IsWritable () const { return mIsWritable ; }
111
112
112
- void SetNonWritable () { mIsWritable = 0 ; }
113
+ void SetNonWritable () { mIsWritable = false ; }
113
114
114
115
// NOTE: the obvious way to implement these functions is to (a) check
115
116
// |mState| is reasonable, and then (b) update |mState|. But the lack of
@@ -190,11 +191,11 @@ class Checker {
190
191
static const uint32_t kReadMax = 9999 ;
191
192
static const uint32_t kWrite = 10000 ;
192
193
193
- mutable mozilla::Atomic<uint32_t , mozilla::SequentiallyConsistent,
194
- mozilla::recordreplay::Behavior::DontPreserve>
194
+ mozilla::Atomic<uint32_t , mozilla::SequentiallyConsistent,
195
+ mozilla::recordreplay::Behavior::DontPreserve>
195
196
mState ;
196
- mutable mozilla::Atomic<uint32_t , mozilla::SequentiallyConsistent,
197
- mozilla::recordreplay::Behavior::DontPreserve>
197
+ mozilla::Atomic<bool , mozilla::SequentiallyConsistent,
198
+ mozilla::recordreplay::Behavior::DontPreserve>
198
199
mIsWritable ;
199
200
};
200
201
#endif
0 commit comments