@@ -20,7 +20,7 @@ use time::OffsetDateTime as DateTime;
20
20
/// and read exactly once in order to set the cookie value.
21
21
///
22
22
/// ## Change tracking session tracks whether any of its inner data
23
- /// was changed since it was last serialized. Any sessoin store that
23
+ /// was changed since it was last serialized. Any session store that
24
24
/// does not undergo a serialization-deserialization cycle must call
25
25
/// [`Session::reset_data_changed`] in order to reset the change tracker on
26
26
/// an individual record.
@@ -157,7 +157,7 @@ impl Session {
157
157
/// assert!(session.is_destroyed());
158
158
/// # Ok(()) }) }
159
159
pub fn destroy ( & mut self ) {
160
- self . destroy . store ( true , Ordering :: Relaxed ) ;
160
+ self . destroy . store ( true , Ordering :: SeqCst ) ;
161
161
}
162
162
163
163
/// returns true if this session is marked for destruction
@@ -174,7 +174,7 @@ impl Session {
174
174
/// # Ok(()) }) }
175
175
176
176
pub fn is_destroyed ( & self ) -> bool {
177
- self . destroy . load ( Ordering :: Relaxed )
177
+ self . destroy . load ( Ordering :: SeqCst )
178
178
}
179
179
180
180
/// Gets the session id
@@ -230,7 +230,7 @@ impl Session {
230
230
let mut data = self . data . write ( ) . unwrap ( ) ;
231
231
if data. get ( key) != Some ( & value) {
232
232
data. insert ( key. to_string ( ) , value) ;
233
- self . data_changed . store ( true , Ordering :: Relaxed ) ;
233
+ self . data_changed . store ( true , Ordering :: Release ) ;
234
234
}
235
235
}
236
236
@@ -281,7 +281,7 @@ impl Session {
281
281
pub fn remove ( & mut self , key : & str ) {
282
282
let mut data = self . data . write ( ) . unwrap ( ) ;
283
283
if data. remove ( key) . is_some ( ) {
284
- self . data_changed . store ( true , Ordering :: Relaxed ) ;
284
+ self . data_changed . store ( true , Ordering :: Release ) ;
285
285
}
286
286
}
287
287
@@ -479,7 +479,7 @@ impl Session {
479
479
/// # Ok(()) }) }
480
480
/// ```
481
481
pub fn data_changed ( & self ) -> bool {
482
- self . data_changed . load ( Ordering :: Relaxed )
482
+ self . data_changed . load ( Ordering :: Acquire )
483
483
}
484
484
485
485
/// Resets `data_changed` dirty tracking. This is unnecessary for
@@ -503,7 +503,7 @@ impl Session {
503
503
/// # Ok(()) }) }
504
504
/// ```
505
505
pub fn reset_data_changed ( & self ) {
506
- self . data_changed . store ( false , Ordering :: Relaxed ) ;
506
+ self . data_changed . store ( false , Ordering :: SeqCst ) ;
507
507
}
508
508
509
509
/// Ensures that this session is not expired. Returns None if it is expired
0 commit comments