about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2023-11-30 14:43:15 +0100
committerjoboet <jonasboettiger@icloud.com>2024-02-09 14:58:38 +0100
commit69f55de5acd153fc109ea688ae5a55d6e7b617ab (patch)
tree9d5a25acd8703b8a48279769801e14e099c6c9b7
parent1fd9f7898ee598de299d7101381847bb6a7782ca (diff)
downloadrust-69f55de5acd153fc109ea688ae5a55d6e7b617ab.tar.gz
rust-69f55de5acd153fc109ea688ae5a55d6e7b617ab.zip
format using latest rustfmt
-rw-r--r--library/std/src/sys/pal/unix/locks/queue_rwlock.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/library/std/src/sys/pal/unix/locks/queue_rwlock.rs b/library/std/src/sys/pal/unix/locks/queue_rwlock.rs
index 37b821db072..3a69556165e 100644
--- a/library/std/src/sys/pal/unix/locks/queue_rwlock.rs
+++ b/library/std/src/sys/pal/unix/locks/queue_rwlock.rs
@@ -510,7 +510,9 @@ impl RwLock {
                 // `state`, so the first non-null tail field will be current
                 // (invariant 2). Invariant 4 is fullfilled since `find_tail`
                 // was called on this node, which ensures all backlinks are set.
-                unsafe { to_node(state).as_ref().tail.set(Some(prev)); }
+                unsafe {
+                    to_node(state).as_ref().tail.set(Some(prev));
+                }
 
                 // Release the queue lock. Doing this by subtraction is more
                 // efficient on modern processors since it is a single instruction
@@ -520,14 +522,18 @@ impl RwLock {
 
                 // The tail was split off and the lock released. Mark the node as
                 // completed.
-                unsafe { return Node::complete(tail); }
+                unsafe {
+                    return Node::complete(tail);
+                }
             } else {
                 // The next waiter is a reader or the queue only consists of one
                 // waiter. Just wake all threads.
 
                 // The lock cannot be locked (checked above), so mark it as
                 // unlocked to reset the queue.
-                if let Err(new) = self.state.compare_exchange_weak(state, UNLOCKED, Release, Acquire) {
+                if let Err(new) =
+                    self.state.compare_exchange_weak(state, UNLOCKED, Release, Acquire)
+                {
                     state = new;
                     continue;
                 }
@@ -535,7 +541,9 @@ impl RwLock {
                 let mut current = tail;
                 loop {
                     let prev = unsafe { current.as_ref().prev.get() };
-                    unsafe { Node::complete(current); }
+                    unsafe {
+                        Node::complete(current);
+                    }
                     match prev {
                         Some(prev) => current = prev,
                         None => return,