@@ -20,7 +20,7 @@ use time::OffsetDateTime as DateTime;
2020/// and read exactly once in order to set the cookie value.
2121///
2222/// ## 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
2424/// does not undergo a serialization-deserialization cycle must call
2525/// [`Session::reset_data_changed`] in order to reset the change tracker on
2626/// an individual record.
@@ -157,7 +157,7 @@ impl Session {
157157 /// assert!(session.is_destroyed());
158158 /// # Ok(()) }) }
159159 pub fn destroy ( & mut self ) {
160- self . destroy . store ( true , Ordering :: Relaxed ) ;
160+ self . destroy . store ( true , Ordering :: SeqCst ) ;
161161 }
162162
163163 /// returns true if this session is marked for destruction
@@ -174,7 +174,7 @@ impl Session {
174174 /// # Ok(()) }) }
175175
176176 pub fn is_destroyed ( & self ) -> bool {
177- self . destroy . load ( Ordering :: Relaxed )
177+ self . destroy . load ( Ordering :: SeqCst )
178178 }
179179
180180 /// Gets the session id
@@ -230,7 +230,7 @@ impl Session {
230230 let mut data = self . data . write ( ) . unwrap ( ) ;
231231 if data. get ( key) != Some ( & value) {
232232 data. insert ( key. to_string ( ) , value) ;
233- self . data_changed . store ( true , Ordering :: Relaxed ) ;
233+ self . data_changed . store ( true , Ordering :: Release ) ;
234234 }
235235 }
236236
@@ -281,7 +281,7 @@ impl Session {
281281 pub fn remove ( & mut self , key : & str ) {
282282 let mut data = self . data . write ( ) . unwrap ( ) ;
283283 if data. remove ( key) . is_some ( ) {
284- self . data_changed . store ( true , Ordering :: Relaxed ) ;
284+ self . data_changed . store ( true , Ordering :: Release ) ;
285285 }
286286 }
287287
@@ -479,7 +479,7 @@ impl Session {
479479 /// # Ok(()) }) }
480480 /// ```
481481 pub fn data_changed ( & self ) -> bool {
482- self . data_changed . load ( Ordering :: Relaxed )
482+ self . data_changed . load ( Ordering :: Acquire )
483483 }
484484
485485 /// Resets `data_changed` dirty tracking. This is unnecessary for
@@ -503,7 +503,7 @@ impl Session {
503503 /// # Ok(()) }) }
504504 /// ```
505505 pub fn reset_data_changed ( & self ) {
506- self . data_changed . store ( false , Ordering :: Relaxed ) ;
506+ self . data_changed . store ( false , Ordering :: SeqCst ) ;
507507 }
508508
509509 /// Ensures that this session is not expired. Returns None if it is expired
0 commit comments