V Qc@s^ddlZddlZdefdYZdddYZdZdZedS( iNtKilledcBseZRS((t__name__t __module__(((s./usr/lib64/python2.7/Demo/threads/Generator.pyRst GeneratorcBs>eZdZdZdZdZdZdZRS(cCsstj|_tj|_|jj|jj||_||_d|_d|_tj |j ddS(Ni(( tthreadt allocate_locktgetlocktputlocktacquiretfunctargstdonetkilledtstart_new_threadt_start(tselfR R ((s./usr/lib64/python2.7/Demo/threads/Generator.pyt__init__ s      cCsyzO|jj|jsNyt|j|f|jWqNtk rJqNXnWd|jstd|_|jj nXdS(Ni( RRR tapplyR R RR Rtrelease(R((s./usr/lib64/python2.7/Demo/threads/Generator.pyRs      cCsN|jrtdn||_|jj|jj|jrJtndS(Ns put() called on killed generator(R t TypeErrortvalueRRRRR(RR((s./usr/lib64/python2.7/Demo/threads/Generator.pytput%s      cCsH|jrtdn|jj|jj|jrAtn|jS(Ns get() called on killed generator( R RRRRRR tEOFErrorR(R((s./usr/lib64/python2.7/Demo/threads/Generator.pytget/s      cCs/|jrtdnd|_|jjdS(Ns!kill() called on killed generatori(R RRR(R((s./usr/lib64/python2.7/Demo/threads/Generator.pytkill9s   cCst|j|jS(N(RR R (R((s./usr/lib64/python2.7/Demo/threads/Generator.pytclone@s(RRRRRRRR(((s./usr/lib64/python2.7/Demo/threads/Generator.pyR s   c Csd\}}}}}x||d|d|d}}}||||||||||f\}}}}||||}} xU|| kr|jt|d||d||}}||||}} qWqdS(Nllll l (llll l(Rtint( tgtktatbta1tb1tptqtdtd1((s./usr/lib64/python2.7/Demo/threads/Generator.pytpiCs$6cCsttd}|jttd}xtdD]}|jGq5WH|j}|jx|jGtjjqcdS(Ni ((( RR%RtrangeRRtsyststdouttflush(Rtith((s./usr/lib64/python2.7/Demo/threads/Generator.pyttestPs    ((R'Rt ExceptionRRR%R,(((s./usr/lib64/python2.7/Demo/threads/Generator.pyts  :