Lines Matching refs:guard
161 let mut guard = result.inner.lock(); in new() localVariable
162 guard.self_ref = Arc::downgrade(&result); in new()
164 drop(guard); //这一步其实不需要,只要离开作用域,guard生命周期结束,自会解锁 in new()
281 let mut guard = self.inner.lock(); in open() localVariable
287 guard.reader += 1; in open()
290 guard.writer += 1; in open()
314 let mut guard = self.inner.lock(); in close() localVariable
318 assert!(guard.writer > 0); in close()
319 guard.writer -= 1; in close()
321 if guard.writer == 0 { in close()
329 assert!(guard.reader > 0); in close()
330 guard.reader -= 1; in close()
332 if guard.reader == 0 { in close()