File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -558,7 +558,7 @@ fn test_downgrade_atomic() {
558558 // modify the protected value.
559559
560560 // `W` is the number of evil writer threads.
561- const W : usize = if cfg ! ( target_pointer_width = "64" ) { 100 } else { 20 } ;
561+ const W : usize = 20 ;
562562 let rwlock = Arc :: new ( RwLock :: new ( 0 ) ) ;
563563
564564 // Spawns many evil writer threads that will try and write to the locked value before the
Original file line number Diff line number Diff line change @@ -395,9 +395,9 @@ impl RwLock {
395395 node. next . 0 = AtomicPtr :: new ( state. mask ( NODE_MASK ) . cast ( ) ) ;
396396 node. prev = AtomicLink :: new ( None ) ;
397397
398- // Set the `QUEUED` bit and maintain the `LOCKED` bit.
398+ // Set the `QUEUED` bit and preserve the `LOCKED` and `DOWNGRADED ` bit.
399399 let mut next = ptr:: from_ref ( & node)
400- . map_addr ( |addr| addr | QUEUED | ( state. addr ( ) & LOCKED ) )
400+ . map_addr ( |addr| addr | QUEUED | ( state. addr ( ) & ( DOWNGRADED | LOCKED ) ) )
401401 as State ;
402402
403403 let mut is_queue_locked = false ;
You can’t perform that action at this time.
0 commit comments