rest25/library/mutex.rst => rest262/library/mutex.rst
f1
2:mod:`mutex` --- Mutual exclusion support
3=========================================
4
5.. module:: mutex
6   :synopsis: Lock and queue for mutual exclusion.
n7+   :deprecated:
8+ 
9+.. deprecated::
10+   The :mod:`mutex` module has been removed in Python 3.0.
11+ 
7.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
8
9
10The :mod:`mutex` module defines a class that allows mutual-exclusion via
n11-acquiring and releasing locks. It does not require (or imply) threading or
n16+acquiring and releasing locks. It does not require (or imply)
12-multi-tasking, though it could be useful for those purposes.
17+:mod:`threading` or multi-tasking, though it could be useful for those
18+purposes.
13
14The :mod:`mutex` module defines the following class:
15
16
17.. class:: mutex()
18
19   Create a new (unlocked) mutex.
20
32.. _mutex-objects:
33
34Mutex Objects
35-------------
36
37:class:`mutex` objects have following methods:
38
39
n40-.. method:: XXX Class.test()
n46+.. method:: mutex.test()
41
42   Check whether the mutex is locked.
43
44
n45-.. method:: XXX Class.testandset()
n51+.. method:: mutex.testandset()
46
47   "Atomic" test-and-set, grab the lock if it is not set, and return ``True``,
48   otherwise, return ``False``.
49
50
n51-.. method:: XXX Class.lock(function, argument)
n57+.. method:: mutex.lock(function, argument)
52
53   Execute ``function(argument)``, unless the mutex is locked. In the case it is
54   locked, place the function and argument on the queue. See :meth:`unlock` for
55   explanation of when ``function(argument)`` is executed in that case.
56
57
t58-.. method:: XXX Class.unlock()
t64+.. method:: mutex.unlock()
59
60   Unlock the mutex if queue is empty, otherwise execute the first element in the
61   queue.
62
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op