ó õùPc@s·ddlZddlZddlZddlmZmZddlmZmZdddddd gZ i ej d 6ej d 6ej d 6ej d 6ejd6ejd6ejd6ejd6ejd6ejd6ejd6ejd6Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Z d„Z!d Z"iZ#ej$ƒZ%d!e&fd"„ƒYZ'd#e'fd$„ƒYZ(d%e'fd&„ƒYZ)d'e)fd(„ƒYZ*dS()iÿÿÿÿN(theaptRLock(tassert_spawningtForkingPicklertRawValuetRawArraytValuetArraytcopyt synchronizedtctutbtBthtHtitItltLtftdcCs.tj|ƒ}tj|ƒ}t||dƒS(N(tctypestsizeofRt BufferWrappert rebuild_ctypetNone(ttype_tsizetwrapper((s-..\python\lib\multiprocessing\sharedctypes.pyt _new_value#scGsTtj||ƒ}t|ƒ}tjtj|ƒdtj|ƒƒ|j|Œ|S(s> Returns a ctypes object allocated from shared memory i(ttypecode_to_typetgetRRtmemsett addressofRt__init__(ttypecode_or_typetargsRtobj((s-..\python\lib\multiprocessing\sharedctypes.pyR(s  % cCsftj||ƒ}t|tƒr5||}t|ƒS|t|ƒ}t|ƒ}|j|Œ|SdS(s= Returns a ctypes array allocated from shared memory N(RR t isinstancetintRtlenR#(R$tsize_or_initializerRtresult((s-..\python\lib\multiprocessing\sharedctypes.pyR2s    cOs|jddƒ}|r1td|jƒƒ‚nt||Œ}|tkrP|S|tdfkrntƒ}nt|dƒst d|ƒ‚nt ||ƒS(s6 Return a synchronization wrapper for a Value tlocks$unrecognized keyword argument(s): %stacquires'%r' has no method 'acquire'N( tpopRt ValueErrortkeysRtFalsetTrueRthasattrtAttributeErrorR (R$R%tkwdsR,R&((s-..\python\lib\multiprocessing\sharedctypes.pyR@s  cKs|jddƒ}|r1td|jƒƒ‚nt||ƒ}|tkrP|S|tdfkrntƒ}nt|dƒst d|ƒ‚nt ||ƒS(s9 Return a synchronization wrapper for a RawArray R,s$unrecognized keyword argument(s): %sR-s'%r' has no method 'acquire'N( R.RR/R0RR1R2RR3R4R (R$R*R5R,R&((s-..\python\lib\multiprocessing\sharedctypes.pyRPs  cCs)tt|ƒƒ}|tj|ƒd<|S(Ni(RttypeRtpointer(R&tnew_obj((s-..\python\lib\multiprocessing\sharedctypes.pyR`scCst|tƒ stdƒ‚t|tjƒr;t||ƒSt|tjƒry|jtjkrlt ||ƒSt ||ƒSt |ƒ}yt |}Wnqt k rg|jD]}|d^q­}td„|Dƒƒ}d|j}t |tf|ƒ}t |tst Synchronized(R'tSynchronizedBasetAssertionErrorRt _SimpleCDataR<Rt_type_tc_chartSynchronizedStringtSynchronizedArrayR6t class_cachetKeyErrort_fields_tdictt__name__(R&R,tclstsclstfieldtnamesRt classname((s-..\python\lib\multiprocessing\sharedctypes.pyR es        !cCsXt|ƒt|tjƒr8t|j|j|jffStt|ƒ|jdffSdS(N( RR'RRRR@t_wrappert_length_R6R(R&((s-..\python\lib\multiprocessing\sharedctypes.pyt reduce_ctype}s cCsK|dk r||}ntj|tƒ|j|jƒƒ}||_|S(N(RRtregisterRPt from_addresst get_addressRN(RRtlengthR&((s-..\python\lib\multiprocessing\sharedctypes.pyR„s    cBsPy e|SWn=ek rKi}e|fd|U||e|<||SXdS(Ni(t prop_cacheREttemplate(R;R((s-..\python\lib\multiprocessing\sharedctypes.pyR9s  sÿ def get%s(self): self.acquire() try: return self._obj.%s finally: self.release() def set%s(self, value): self.acquire() try: self._obj.%s = value finally: self.release() %s = property(get%s, set%s) R=cBs8eZdd„Zd„Zd„Zd„Zd„ZRS(cCs=||_|ptƒ|_|jj|_|jj|_dS(N(t_objRt_lockR-trelease(tselfR&R,((s-..\python\lib\multiprocessing\sharedctypes.pyR#²s cCs t|ƒt|j|jffS(N(RR RWRX(RZ((s-..\python\lib\multiprocessing\sharedctypes.pyt __reduce__¸s cCs|jS(N(RW(RZ((s-..\python\lib\multiprocessing\sharedctypes.pytget_obj¼scCs|jS(N(RX(RZ((s-..\python\lib\multiprocessing\sharedctypes.pytget_lock¿scCsdt|ƒj|jfS(Ns<%s wrapper for %s>(R6RHRW(RZ((s-..\python\lib\multiprocessing\sharedctypes.pyt__repr__ÂsN(RHt __module__RR#R[R\R]R^(((s-..\python\lib\multiprocessing\sharedctypes.pyR=°s     R<cBseZedƒZRS(tvalue(RHR_R9R`(((s-..\python\lib\multiprocessing\sharedctypes.pyR<ÆsRCcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs t|jƒS(N(R)RW(RZ((s-..\python\lib\multiprocessing\sharedctypes.pyt__len__ÌscCs+|jƒz|j|SWd|jƒXdS(N(R-RWRY(RZR((s-..\python\lib\multiprocessing\sharedctypes.pyt __getitem__Ïs cCs-|jƒz||j| s:            "