Lines Matching refs:owner
110 /// The ID of the thread that owns this pool. The owner is the thread
111 /// that makes the first call to 'get'. When the owner calls 'get', it
118 owner: AtomicUsize,
160 .field("owner", &self.owner)
183 let owner = AtomicUsize::new(0);
185 Pool { stack: Mutex::new(vec![]), create, owner, owner_val }
205 // owner, then only one thread may receive this value.
207 let owner = self.owner.load(Ordering::Relaxed);
208 if caller == owner {
211 self.get_slow(caller, owner)
218 /// If the pool has no owner, then this will set the owner.
220 fn get_slow(&self, caller: usize, owner: usize) -> PoolGuard<'_, T> {
223 if owner == 0 {
225 // try to atomically set the owner. If we do, then this thread
226 // becomes the owner and we can return a guard that represents
227 // the special T for the owner.
228 let res = self.owner.compare_exchange(0, caller, Relaxed, Relaxed);
293 // Tests that Pool implements the "single owner" optimization. That is, the
322 // If we didn't implement the single owner optimization, then one of