This module provides low-level primitives for working with multiple
threads (a.k.a. light-weight processes or tasks) --- multiple
threads of control sharing their global data space. For
synchronization, simple locks (a.k.a. mutexes or binary
semaphores) are provided.
The module is optional. It is supported on Windows NT and '95, SGI
IRIX, Solaris 2.x, as well as on systems that have a POSIX thread
(a.k.a. ``pthread'') implementation.
POSIX It defines the following constant and functions:
Lock objects have the following methods:
Caveats:error
LockType
start_new_thread(function, args[, kwargs])
exit()
exit_thread()
allocate_lock()
get_ident()
lockacquire([waitflag])
None. If the integer
waitflag argument is present, the action depends on its
value: if it is zero, the lock is only acquired if it can be acquired
immediately without waiting, while if it is nonzero, the lock is
acquired unconditionally as before. If an argument is present, the
return value is 1 if the lock is acquired successfully,
0 if not.
lockrelease()
locklocked()
1 if it has been acquired by
some thread, 0 if not.