-í D;(>csŤdZdkZdklZdklZlZdkZdk l Z ddZ dei fd„ƒYZ d e fd „ƒYZd e fd „ƒYZd fd„ƒYZdS(s)Compromising positions involving threads.N(s Transaction(s zodb_picklesMinPO(sClientDisconnectedsis BasicThreadcstZd„Zd„ZRS(NcsZ||_tƒ|_||_||_d|_d|_ti i |ƒ|i dƒdS(Nii( sstoragesselfs Transactionstranss doNextEventsthreadStartedEvents gotValueErrorsgotDisconnecteds threadingsThreads__init__s setDaemon(sselfsstorages doNextEventsthreadStartedEvent((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys__init__s      cstii|dƒdS(Ni (s threadingsThreadsjoinsself(sself((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pysjoin%s(s__name__s __module__s__init__sjoin(((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys BasicThreads sGetsThroughVoteThreadcstZd„ZRS(NcsĐ|ii|iƒ|iiƒ}|ii|ttt dƒƒd|iƒ|ii |iƒ|i i ƒ|i idƒy|ii|iƒWn5tiij o#d|_|ii|iƒnXdS(Nscsi i(sselfsstorages tpc_beginstranssnew_oidsoidsstoresZEROs zodb_picklesMinPOstpc_votesthreadStartedEventssets doNextEventswaits tpc_finishsZEOs ClientStoragesClientStorageErrors gotValueErrors tpc_abort(sselfsoid((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pysrun2s+  (s__name__s __module__srun(((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pysGetsThroughVoteThread*ssGetsThroughBeginThreadcstZd„ZRS(Ncs@y|ii|iƒWn"tiij od|_nXdS(Ni(sselfsstorages tpc_beginstranssZEOs ClientStoragesClientStorageErrors gotValueError(sself((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pysrunEs(s__name__s __module__srun(((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pysGetsThroughBeginThread@ss ThreadTestscs,tZd„Zd„Zd„Zd„ZRS(Ncs|tiƒ}tiƒ}t|i||ƒ}|iƒ|i dƒ|ii ƒ|i ƒ|i ƒ|i |idƒdS(Ni i(s threadingsEvents doNextEventsthreadStartedEventsGetsThroughVoteThreadsselfs_storagesthread1sstartswaitsclosessetsjoins assertEquals gotValueError(sselfsthread1s doNextEventsthreadStartedEvent((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pyscheckDisconnectedOnThread2ClosePs         cs¸tiƒ}tiƒ}t|i||ƒ}t|i||ƒ}|i ƒ|i dƒ|i ƒ|ii ƒ|i ƒ|iƒ|iƒ|i|idƒ|i|idƒdS(Ni(s threadingsEvents doNextEventsthreadStartedEventsGetsThroughVoteThreadsselfs_storagesthread1sGetsThroughBeginThreadsthread2sstartswaitsclosessetsjoins assertEquals gotValueError(sselfsthread2sthread1s doNextEventsthreadStartedEvent((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pyscheckSecondBeginFailsas             csg}x@tdƒD]2}tid|iƒ}|i|ƒ|i ƒqWx|D]}|i dƒqPWx"|D]}|i |i ƒ ƒqnWdS(Nistargeti( sthreadssrangesis threadingsThreadsselfs mtstorehelperstsappendsstartsjoins failUnlesssisAlive(sselfsthreadsstsi((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys checkMTStoresss  cs~tiƒiƒ}g}x>tdƒD]0}|itddƒƒ|itdƒƒq%Wx|D]}|i d|ƒq`WdS(Ni sXi@ sdata( s threadings currentThreadsgetNamesnamesobjssrangesisappendsMinPOsobjsselfs_dostore(sselfsobjsnamesisobjs((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys mtstorehelpers (s__name__s __module__scheckDisconnectedOnThread2ClosescheckSecondBeginFailss checkMTStoress mtstorehelper(((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys ThreadTestsLs   (s__doc__s threadingsZODB.Transactions TransactionsZODB.tests.StorageTestBases zodb_picklesMinPOsZEO.ClientStoragesZEOsZEO.ExceptionssClientDisconnectedsZEROsThreads BasicThreadsGetsThroughVoteThreadsGetsThroughBeginThreads ThreadTests( s TransactionsClientDisconnecteds zodb_picklesGetsThroughBeginThreads ThreadTestssZEOs threadingsZEROsGetsThroughVoteThreads BasicThreadsMinPO((s=/usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys?s