config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/test_threading.pyo

³ò
h”Rc@sêddkZddklZddkZddkZddkZddkZddkZddkZde	fd„ƒYZ
deifd„ƒYZdei
fd„ƒYZd	ei
fd
„ƒYZd„ZedjoeƒndS(
iÿÿÿÿN(tverbosetCountercBs,eZd„Zd„Zd„Zd„ZRS(cCs
d|_dS(Ni(tvalue(tself((s//usr/local/lib/python2.5/test/test_threading.pyt__init__scCs|id7_dS(Ni(R(R((s//usr/local/lib/python2.5/test/test_threading.pytincscCs|id8_dS(Ni(R(R((s//usr/local/lib/python2.5/test/test_threading.pytdecscCs|iS(N(R(R((s//usr/local/lib/python2.5/test/test_threading.pytgets(t__name__t
__module__RRRR(((s//usr/local/lib/python2.5/test/test_threading.pyR
s			t
TestThreadcBseZd„Zd„ZRS(cCs>tii|d|ƒ||_||_||_||_dS(Ntname(t	threadingtThreadRttestcasetsematmutextnrunning(RRRRRR((s//usr/local/lib/python2.5/test/test_threading.pyRs
			cCsStiƒd}todG|iƒGdG|GdGHn|iiƒ|iiƒ|iiƒto|iiƒGdGHn|i	i
|iiƒdjƒ|iiƒti
|ƒtodG|iƒGdGHn|iiƒ|iiƒ|i	i
|iiƒdjƒto$|iƒGd	G|iiƒGdGHn|iiƒ|iiƒdS(
Nittaskswill run fortsecstasks are runningitdoneisis finished.(trandomRtgetNameRtacquireRRRRRtassert_treleasettimetsleepR(Rtdelay((s//usr/local/lib/python2.5/test/test_threading.pytruns*






	
(RR	RR(((s//usr/local/lib/python2.5/test/test_threading.pyR
s	tThreadTestscBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCséd}tiddƒ}tiƒ}tƒ}g}xGt|ƒD]9}td|||||ƒ}|i|ƒ|iƒq@Wto	dGHnx/|D]'}|i	|ƒ|i
|iƒƒq”Wto	dGHn|i|i
ƒdƒdS(Ni
Ris<thread %d>s!waiting for all tasks to completesall tasks donei(RtBoundedSemaphoretRLockRtrangeR
tappendtstartRtjoinRtisAlivetassertEqualR(RtNUMTASKSRRt
numrunningtthreadstitt((s//usr/local/lib/python2.5/test/test_threading.pyttest_various_ops?s&	

	
	cCsito	dGHnytidƒWn*tij
oto	dGHndSnX|iƒtidƒdS(Nswith 256kB thread stack size...is4platform does not support changing thread stack sizei(RRt
stack_sizetthreadterrorR,(R((s//usr/local/lib/python2.5/test/test_threading.pyttest_various_ops_small_stackZs			
cCsito	dGHnytidƒWn*tij
oto	dGHndSnX|iƒtidƒdS(Nswith 1MB thread stack size...is4platform does not support changing thread stack sizei(RRR-R.R/R,(R((s//usr/local/lib/python2.5/test/test_threading.pyttest_various_ops_large_stackgs			
cCs‚d„}tiƒ}|iƒti||fƒ}|iƒ|i|tijƒ|itti|tiƒƒti|=dS(NcSs.tiƒ}|iƒ|iƒ|iƒdS(N(RR RR(Rtr((s//usr/local/lib/python2.5/test/test_threading.pytfus

(	RtLockRR.tstart_new_threadRt_activet
isinstancet_DummyThread(RR3Rttid((s//usr/local/lib/python2.5/test/test_threading.pyttest_foreign_threadss	


c	sâyddk}Wn'tj
oto	dGHndSnX|ii}dtfd„ƒY‰|iˆƒ}tiƒ‰tiƒ‰dti	f‡‡‡fd†ƒY}|ƒ}|i
tƒ|iƒto	dGHnto	dGHn||i
dƒ|ƒ}|i|d	ƒto	d
GHnˆiƒto	dGHn|i|iƒto	dGHn||i
|iƒ|ƒ}|i|d
ƒto	dGHnˆiddƒ|i|iƒto	dGHn|io|iƒndS(Niÿÿÿÿs2test_PyThreadState_SetAsyncExc can't import ctypestAsyncExccBseZRS((RR	(((s//usr/local/lib/python2.5/test/test_threading.pyR;“stWorkercseZ‡‡‡fd†ZRS(csotiƒ|_t|_y*x#toˆiƒtidƒqWWn&ˆj
ot|_ˆiƒnXdS(Ngš™™™™™¹?(	R.t	get_identtidtFalsetfinishedtTruetsetRR(R(tworker_saw_exceptiontworker_startedR;(s//usr/local/lib/python2.5/test/test_threading.pyR s	
	(RR	R((RCR;RD(s//usr/local/lib/python2.5/test/test_threading.pyR<Ÿss    started worker threads     trying nonsensical thread idis,    waiting for worker thread to get starteds"    verifying worker hasn't exiteds2    attempting to raise asynch exception in workeris5    waiting for worker to say it caught the exceptionttimeouti
s    all OK -- joining worker(tctypestImportErrorRt	pythonapitPyThreadState_SetAsyncExct	Exceptiont	py_objectRtEventR
t	setDaemonRAR#tc_longR&twaitRR@R>R$(RRFt
set_async_exct	exceptionR<R+tresult((RDRCR;s//usr/local/lib/python2.5/test/test_threading.pyttest_PyThreadState_SetAsyncExc‰sN		%
	

			
				
c	Cs§ti}tiƒ}tidƒzpxitddƒD]X}tidd„ƒ}|iƒ|iƒ|ƒ}|i	||jd||fƒq5WWdti|ƒXdS(NiièttargetcSsdS(N(tNone(((s//usr/local/lib/python2.5/test/test_threading.pyt<lambda>Õss&#1703448 triggered after %d trials: %s(
Rt	enumeratetsystgetcheckintervaltsetcheckintervaltxrangeR
R#R$tassertFalse(Rtenumtold_intervalR*R+tl((s//usr/local/lib/python2.5/test/test_threading.pyttest_enumerate_after_joinÍs	


	(RR	R,R0R1R:RSR`(((s//usr/local/lib/python2.5/test/test_threading.pyR;s		
			DtThreadJoinOnShutdowncBs,eZd„Zd„Zd„Zd„ZRS(cCs¡d|}ddk}|itid|gd|iƒ}|iƒ}|iiƒiddƒ}|i	|dƒ|i
|djd	ƒ|i|d
jdƒdS(Nsóif 1:
            import sys, os, time, threading

            # a thread, which waits for the main program to terminate
            def joiningfunc(mainthread):
                mainthread.join()
                print 'end of thread'
        
iÿÿÿÿs-ctstdouts
tsend of main
end of thread
isinterpreter was blockedisUnexpected error(t
subprocesstPopenRXt
executabletPIPERORbtreadtreplaceR&tfailIft
failUnless(RtscriptRdtptrctdata((s//usr/local/lib/python2.5/test/test_threading.pyt
_run_and_joinás
$cCsd}|i|ƒdS(Nsóif 1:
            import os
            t = threading.Thread(target=joiningfunc,
                                 args=(threading.currentThread(),))
            t.start()
            time.sleep(0.1)
            print 'end of main'
            (Rp(RRl((s//usr/local/lib/python2.5/test/test_threading.pyttest_1_join_on_shutdownós	cCs;ddk}t|dƒpdSnd}|i|ƒdS(NiÿÿÿÿtforksEif 1:
            childpid = os.fork()
            if childpid != 0:
                os.waitpid(childpid, 0)
                sys.exit(0)

            t = threading.Thread(target=joiningfunc,
                                 args=(threading.currentThread(),))
            t.start()
            print 'end of main'
            (tosthasattrRp(RRsRl((s//usr/local/lib/python2.5/test/test_threading.pyttest_2_join_in_forked_processs
cCsiddk}t|dƒpdSntid	jotidItiIJdSnd}|i|ƒdS(
NiÿÿÿÿRrtfreebsd4tfreebsd5tfreebsd6tos2emxsBSkipping test_3_join_in_forked_from_thread due to known OS bugs ons8if 1:
            main_thread = threading.currentThread()
            def worker():
                childpid = os.fork()
                if childpid != 0:
                    os.waitpid(childpid, 0)
                    sys.exit(0)

                t = threading.Thread(target=joiningfunc,
                                     args=(main_thread,))
                print 'end of main'
                t.start()
                t.join() # Should not block: main_thread is already stopped

            w = threading.Thread(target=worker)
            w.start()
            (RvRwRxsos2emx(RsRtRXtplatformtstderrRp(RRsRl((s//usr/local/lib/python2.5/test/test_threading.pyt!test_3_join_in_forked_from_threads
	(RR	RpRqRuR|(((s//usr/local/lib/python2.5/test/test_threading.pyRaßs		
	cCstiittƒdS(N(ttestttest_supporttrun_unittestRRa(((s//usr/local/lib/python2.5/test/test_threading.pyt	test_main2st__main__(ttest.test_supportR}RRRXRR.RtunittesttobjectRR
R
tTestCaseRRaR€R(((s//usr/local/lib/python2.5/test/test_threading.pys<module>s
$¤S	


Man Man