• Home
  • Raw
  • Download

Lines Matching full:lock

76         lock = self.locktype()
77 del lock
80 lock = self.locktype()
81 lock.acquire()
82 del lock
85 lock = self.locktype()
86 lock.acquire()
87 lock.release()
88 del lock
91 lock = self.locktype()
92 self.assertTrue(lock.acquire(False))
93 lock.release()
96 lock = self.locktype()
97 lock.acquire()
100 result.append(lock.acquire(False))
103 lock.release()
106 lock = self.locktype()
107 lock.acquire()
110 lock.acquire()
111 lock.release()
117 lock.release()
122 lock = self.locktype()
124 lock.acquire()
125 lock.release()
127 with lock:
131 # Check the lock is unacquired
134 # Check the lock is unacquired
138 # The lock shouldn't leak a Thread instance when used from a foreign
140 lock = self.locktype()
142 lock.acquire()
143 lock.release()
157 # Lock needs to be released before re-acquiring.
158 lock = self.locktype()
161 lock.acquire()
163 lock.acquire()
170 lock.release()
176 # Lock can be released from a different thread.
177 lock = self.locktype()
178 lock.acquire()
180 lock.release()
183 lock.acquire()
184 lock.release()
192 lock = self.locktype()
193 lock.acquire()
194 lock.acquire()
195 lock.release()
196 lock.acquire()
197 lock.release()
198 lock.release()
201 # Cannot release an unacquired lock
202 lock = self.locktype()
203 self.assertRaises(RuntimeError, lock.release)
204 lock.acquire()
205 lock.acquire()
206 lock.release()
207 lock.acquire()
208 lock.release()
209 lock.release()
210 self.assertRaises(RuntimeError, lock.release)
214 lock = self.locktype()
216 lock.acquire()
219 self.assertRaises(RuntimeError, lock.release)
224 lock = self.locktype()
225 self.assertFalse(lock._is_owned())
226 lock.acquire()
227 self.assertTrue(lock._is_owned())
228 lock.acquire()
229 self.assertTrue(lock._is_owned())
232 result.append(lock._is_owned())
235 lock.release()
236 self.assertTrue(lock._is_owned())
237 lock.release()
238 self.assertFalse(lock._is_owned())
330 lock = threading.Lock()
331 cond = self.condtype(lock)
333 self.assertFalse(lock.acquire(False))
335 self.assertTrue(lock.acquire(False))
337 lock.release()
339 self.assertFalse(lock.acquire(False))