-í
D;(>c       sŤ   d  Z  d k Z d k l Z d k l Z l Z d k Z d k	 l
 Z
 d d Z d e i f d     YZ d	 e f d
     YZ d e f d     YZ d f  d     YZ d S(   s)   Compromising positions involving threads.N(   s   Transaction(   s   zodb_pickles   MinPO(   s   ClientDisconnecteds    i   s   BasicThreadc      s   t  Z d   Z d   Z RS(   Nc    sZ   | |  _  t   |  _ | |  _ | |  _ d |  _ d |  _ t i	 i
 |   |  i d  d  S(   Ni    i   (   s   storages   selfs   Transactions   transs   doNextEvents   threadStartedEvents   gotValueErrors   gotDisconnecteds	   threadings   Threads   __init__s	   setDaemon(   s   selfs   storages   doNextEvents   threadStartedEvent(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   __init__ s    					c    s   t  i i |  d  d  S(   Ni
   (   s	   threadings   Threads   joins   self(   s   self(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   join% s    (   s   __name__s
   __module__s   __init__s   join(    (    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   BasicThread s   	
s   GetsThroughVoteThreadc      s   t  Z d   Z RS(   Nc    sĐ   |  i i |  i  |  i i   } |  i i | t t t	 d   d |  i  |  i i
 |  i  |  i i   |  i i d  y |  i i |  i  Wn5 t i i j
 o# d |  _ |  i i |  i  n Xd  S(   Ns   cs    i
   i   (   s   selfs   storages	   tpc_begins   transs   new_oids   oids   stores   ZEROs   zodb_pickles   MinPOs   tpc_votes   threadStartedEvents   sets   doNextEvents   waits
   tpc_finishs   ZEOs   ClientStorages   ClientStorageErrors   gotValueErrors	   tpc_abort(   s   selfs   oid(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   run2 s    +	(   s   __name__s
   __module__s   run(    (    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   GetsThroughVoteThread* s   s   GetsThroughBeginThreadc      s   t  Z d   Z RS(   Nc    s@   y |  i i |  i  Wn" t i i j
 o d |  _ n Xd  S(   Ni   (   s   selfs   storages	   tpc_begins   transs   ZEOs   ClientStorages   ClientStorageErrors   gotValueError(   s   self(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   runE s    (   s   __name__s
   __module__s   run(    (    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   GetsThroughBeginThread@ s   s   ThreadTestsc      s,   t  Z d   Z d   Z d   Z d   Z RS(   Nc    s|   t  i   } t  i   } t |  i | |  } | i   | i	 d  |  i i
   | i   | i   |  i | i d  d  S(   Ni
   i   (   s	   threadings   Events   doNextEvents   threadStartedEvents   GetsThroughVoteThreads   selfs   _storages   thread1s   starts   waits   closes   sets   joins   assertEquals   gotValueError(   s   selfs   thread1s   doNextEvents   threadStartedEvent(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   checkDisconnectedOnThread2CloseP s    	


c    s¸   t  i   } t  i   } t |  i | |  } t |  i | |  } | i
   | i d  | i
   |  i i   | i   | i   | i   |  i | i d  |  i | i d  d  S(   Ni   (   s	   threadings   Events   doNextEvents   threadStartedEvents   GetsThroughVoteThreads   selfs   _storages   thread1s   GetsThroughBeginThreads   thread2s   starts   waits   closes   sets   joins   assertEquals   gotValueError(   s   selfs   thread2s   thread1s   doNextEvents   threadStartedEvent(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   checkSecondBeginFailsa s    		




c    s   g  } x@ t d  D]2 } t i d |  i  } | i |  | i	   q Wx | D] } | i
 d  qP Wx" | D] } |  i | i    qn Wd  S(   Ni   s   targeti   (   s   threadss   ranges   is	   threadings   Threads   selfs   mtstorehelpers   ts   appends   starts   joins
   failUnlesss   isAlive(   s   selfs   threadss   ts   i(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   checkMTStoress s       c    s~   t  i   i   } g  } x> t d  D]0 } | i t d d   | i t d   q% Wx | D] } |  i d |  q` Wd  S(   Ni
   s   Xi@ s   data(   s	   threadings   currentThreads   getNames   names   objss   ranges   is   appends   MinPOs   objs   selfs   _dostore(   s   selfs   objs   names   is   objs(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   mtstorehelper s      (   s   __name__s
   __module__s   checkDisconnectedOnThread2Closes   checkSecondBeginFailss   checkMTStoress   mtstorehelper(    (    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   ThreadTestsL s   			(   s   __doc__s	   threadings   ZODB.Transactions   Transactions   ZODB.tests.StorageTestBases   zodb_pickles   MinPOs   ZEO.ClientStorages   ZEOs   ZEO.Exceptionss   ClientDisconnecteds   ZEROs   Threads   BasicThreads   GetsThroughVoteThreads   GetsThroughBeginThreads   ThreadTests(   s   Transactions   ClientDisconnecteds   zodb_pickles   GetsThroughBeginThreads   ThreadTestss   ZEOs	   threadings   ZEROs   GetsThroughVoteThreads   BasicThreads   MinPO(    (    s=   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/ThreadTests.pys   ? s   		
