Lines Matching full:guard
16 use crate::{unprotected, Atomic, Guard, Owned, Shared};
55 let guard = unprotected(); in new() localVariable
56 let sentinel = sentinel.into_shared(guard); in new()
70 guard: &Guard, in push_internal() argument
74 let next = o.next.load(Acquire, guard); in push_internal()
79 .compare_exchange(onto, next, Release, Relaxed, guard); in push_internal()
85 .compare_exchange(Shared::null(), new, Release, Relaxed, guard) in push_internal()
91 .compare_exchange(onto, new, Release, Relaxed, guard); in push_internal()
98 pub(crate) fn push(&self, t: T, guard: &Guard) { in push() argument
103 let new = Owned::into_shared(new, guard); in push()
107 let tail = self.tail.load(Acquire, guard); in push()
110 if self.push_internal(tail, new, guard) { in push()
118 fn pop_internal(&self, guard: &Guard) -> Result<Option<T>, ()> { in pop_internal()
119 let head = self.head.load(Acquire, guard); in pop_internal()
121 let next = h.next.load(Acquire, guard); in pop_internal()
125 .compare_exchange(head, next, Release, Relaxed, guard) in pop_internal()
127 let tail = self.tail.load(Relaxed, guard); in pop_internal()
132 .compare_exchange(tail, next, Release, Relaxed, guard); in pop_internal()
134 guard.defer_destroy(head); in pop_internal()
146 fn pop_if_internal<F>(&self, condition: F, guard: &Guard) -> Result<Option<T>, ()> in pop_if_internal()
151 let head = self.head.load(Acquire, guard); in pop_if_internal()
153 let next = h.next.load(Acquire, guard); in pop_if_internal()
157 .compare_exchange(head, next, Release, Relaxed, guard) in pop_if_internal()
159 let tail = self.tail.load(Relaxed, guard); in pop_if_internal()
164 .compare_exchange(tail, next, Release, Relaxed, guard); in pop_if_internal()
166 guard.defer_destroy(head); in pop_if_internal()
178 pub(crate) fn try_pop(&self, guard: &Guard) -> Option<T> { in try_pop()
180 if let Ok(head) = self.pop_internal(guard) { in try_pop()
190 pub(crate) fn try_pop_if<F>(&self, condition: F, guard: &Guard) -> Option<T> in try_pop_if()
196 if let Ok(head) = self.pop_if_internal(&condition, guard) { in try_pop_if()
206 let guard = unprotected(); in drop() localVariable
208 while self.try_pop(guard).is_some() {} in drop()
211 let sentinel = self.head.load(Relaxed, guard); in drop()
235 let guard = &pin(); in push() localVariable
236 self.queue.push(t, guard); in push()
240 let guard = &pin(); in is_empty() localVariable
241 let head = self.queue.head.load(Acquire, guard); in is_empty()
243 h.next.load(Acquire, guard).is_null() in is_empty()
247 let guard = &pin(); in try_pop() localVariable
248 self.queue.try_pop(guard) in try_pop()