[Python-checkins] CVS: python/dist/src/Doc/lib libimp.tex,1.29,1.30

Tim Peters tim_one@users.sourceforge.net
2001年8月29日 22:16:15 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23325/Doc/lib
Modified Files:
	libimp.tex 
Log Message:
Add a new function imp.lock_held(), and use it to skip test_threaded_import
when that test is doomed to deadlock.
Index: libimp.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libimp.tex,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** libimp.tex	2001年07月06日 19:28:48	1.29
--- libimp.tex	2001年08月30日 05:16:12	1.30
***************
*** 94,97 ****
--- 94,110 ----
 \end{funcdesc}
 
+ \begin{funcdesc}{lock_held}{}
+ Return 1 if the import lock is currently held, else 0.
+ On platforms without threads, always return 0.
+ 
+ On platforms with threads, a thread executing an import holds an internal
+ lock until the import is complete.
+ This lock blocks other threads from doing an import until the original
+ import completes, which in turn prevents other threads from seeing
+ incomplete module objects constructed by the original thread while in
+ the process of completing its import (and the imports, if any,
+ triggered by that).
+ \end{funcdesc}
+ 
 The following constants with integer values, defined in this module,
 are used to indicate the search result of \function{find_module()}.

AltStyle によって変換されたページ (->オリジナル) /