diff options
author | Georg Brandl <georg@python.org> | 2007-08-15 14:26:55 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-08-15 14:26:55 (GMT) |
commit | f56181ff53ba00b7bed3997a4dccd9a1b6217b57 (patch) | |
tree | 1200947a7ffc78c2719831e4c7fd900a8ab01368 /Doc/lib/libmutex.tex | |
parent | af62d9abfb78067a54c769302005f952ed999f6a (diff) | |
download | cpython-f56181ff53ba00b7bed3997a4dccd9a1b6217b57.zip cpython-f56181ff53ba00b7bed3997a4dccd9a1b6217b57.tar.gz cpython-f56181ff53ba00b7bed3997a4dccd9a1b6217b57.tar.bz2 |
Delete the LaTeX doc tree.
Diffstat (limited to 'Doc/lib/libmutex.tex')
-rw-r--r-- | Doc/lib/libmutex.tex | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Doc/lib/libmutex.tex b/Doc/lib/libmutex.tex deleted file mode 100644 index 8c35c96..0000000 --- a/Doc/lib/libmutex.tex +++ /dev/null @@ -1,57 +0,0 @@ -\section{\module{mutex} --- - Mutual exclusion support} - -\declaremodule{standard}{mutex} -\sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} -\modulesynopsis{Lock and queue for mutual exclusion.} - -The \module{mutex} module defines a class that allows mutual-exclusion -via acquiring and releasing locks. It does not require (or imply) -threading or multi-tasking, though it could be useful for -those purposes. - -The \module{mutex} module defines the following class: - -\begin{classdesc}{mutex}{} -Create a new (unlocked) mutex. - -A mutex has two pieces of state --- a ``locked'' bit and a queue. -When the mutex is not locked, the queue is empty. -Otherwise, the queue contains zero or more -\code{(\var{function}, \var{argument})} pairs -representing functions (or methods) waiting to acquire the lock. -When the mutex is unlocked while the queue is not empty, -the first queue entry is removed and its -\code{\var{function}(\var{argument})} pair called, -implying it now has the lock. - -Of course, no multi-threading is implied -- hence the funny interface -for \method{lock()}, where a function is called once the lock is -acquired. -\end{classdesc} - - -\subsection{Mutex Objects \label{mutex-objects}} - -\class{mutex} objects have following methods: - -\begin{methoddesc}[mutex]{test}{} -Check whether the mutex is locked. -\end{methoddesc} - -\begin{methoddesc}[mutex]{testandset}{} -``Atomic'' test-and-set, grab the lock if it is not set, -and return \code{True}, otherwise, return \code{False}. -\end{methoddesc} - -\begin{methoddesc}[mutex]{lock}{function, argument} -Execute \code{\var{function}(\var{argument})}, unless the mutex is locked. -In the case it is locked, place the function and argument on the queue. -See \method{unlock} for explanation of when -\code{\var{function}(\var{argument})} is executed in that case. -\end{methoddesc} - -\begin{methoddesc}[mutex]{unlock}{} -Unlock the mutex if queue is empty, otherwise execute the first element -in the queue. -\end{methoddesc} |