Lines Matching refs:stack
2 // objects. For the most part, it's implemented by a stack represented by a
104 /// A stack of T values to hand out. These are used when a Pool is
106 stack: Mutex<Vec<Box<T>>>,
107 /// A function to create more T values when stack is empty and a caller
112 /// gets 'owner_val' directly instead of returning a T from 'stack'.
133 // being accessed in the same thread in which it was created. The 'stack' field
159 .field("stack", &self.stack)
185 Pool { stack: Mutex::new(vec![]), create, owner, owner_val }
215 /// allocated value off a stack to return to the caller. (Or, if the stack
233 let mut stack = self.stack.lock().unwrap();
234 let value = match stack.pop() {
245 let mut stack = self.stack.lock().unwrap();
246 stack.push(value);
254 /// Create a guard that contains a value from the pool's stack.