Lines Matching defs:lock
65 /* Unlock the lock so it's safe to free it */
75 /* Helper to acquire an interruptible lock with a timeout. If the lock acquire
78 * are returned, depending on whether the lock can be acquired within the
82 acquire_timed(PyThread_type_lock lock, _PyTime_t timeout)
95 r = PyThread_acquire_lock_timed(lock, 0, 0);
98 r = PyThread_acquire_lock_timed(lock, microseconds, 1);
193 Lock the lock. Without argument, this blocks if the lock is already\n\
195 the lock, and return True once the lock is acquired.\n\
197 and the return value reflects whether the lock is acquired.\n\
203 /* Sanity check: the lock must be locked */
205 PyErr_SetString(ThreadError, "release unlocked lock");
218 Release the lock, allowing another thread that is blocked waiting for\n\
219 the lock to acquire the lock. The lock must be in the locked state,\n\
232 Return whether the lock is in the locked state.");
246 PyErr_SetString(ThreadError, "failed to reinitialize lock at fork");
282 "A lock object is a synchronization primitive. To create a lock,\n\
285 acquire() -- lock the lock, possibly blocking until it can be obtained\n\
286 release() -- unlock of the lock\n\
287 locked() -- test whether the lock is currently locked\n\
289 A lock is not owned by the thread that locked it; another thread may\n\
290 unlock it. A thread attempting to lock a lock that it has already locked\n\
309 .name = "_thread.lock",
316 /* Recursive lock objects */
343 /* Unlock the lock so it's safe to free it */
369 "Internal lock count overflowed");
391 Lock the lock. `blocking` indicates whether we should wait\n\
392 for the lock to be available or not. If `blocking` is False\n\
393 and another thread holds the lock, the method will return False\n\
395 the lock, the method will wait for the lock to be released,\n\
400 Precisely, if the current thread already holds the lock, its\n\
401 internal counter is simply incremented. If nobody holds the lock,\n\
402 the lock is taken and its internal counter initialized to 1.");
411 "cannot release un-acquired lock");
424 Release the lock, allowing another thread that is blocked waiting for\n\
425 the lock to acquire the lock. The lock must be in the locked state,\n\
429 Do note that if the lock was acquire()d several times in a row by the\n\
430 current thread, release() needs to be called as many times for the lock\n\
449 PyErr_SetString(ThreadError, "couldn't acquire lock");
471 "cannot release un-acquired lock");
519 PyErr_SetString(ThreadError, "can't allocate lock");
540 PyErr_SetString(ThreadError, "failed to reinitialize lock at fork");
616 PyErr_SetString(ThreadError, "can't allocate lock");
1232 "allocate_lock() -> lock object\n\
1235 Create a new lock object. See help(type(threading.Lock())) for\n\
1303 lockobject *lock;
1305 lock = (lockobject *) obj;
1306 if (lock->locked) {
1307 PyThread_release_lock(lock->lock_lock);
1308 lock->locked = 0;
1321 lockobject *lock;
1324 /* We must support the re-creation of the lock from a
1332 lock = newlockobject(module);
1333 if (lock == NULL)
1335 /* The lock is owned by whoever called _set_sentinel(), but the weakref
1337 wr = PyWeakref_NewRef((PyObject *) lock, NULL);
1339 Py_DECREF(lock);
1344 return (PyObject *) lock;
1348 "_set_sentinel() -> lock\n\
1350 Set a sentinel lock that will be released when the current thread\n\