7ec@sddlZddlZddlZddlmZmZddlmZmZdddddd gZ i ej d 6ej d 6ej d 6ej d 6ejd6ejd6ejd6ejd6ejd6ejd6ejd6Zyejed Returns a ctypes object allocated from shared memory i(ttypecode_to_typetgetRRtmemsett addressofRt__init__(ttypecode_or_typetargsRtobj((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRGs  % cCstj||}t|ttfrf||}t|}tjtj|dtj ||S|t |}t|}|j ||SdS(s= Returns a ctypes array allocated from shared memory iN( RR t isinstancetinttlongRRR!R"RtlenR#(R$tsize_or_initializerRR&tresult((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRQs  %  cOs|jdd}|r1td|jnt||}|tkrP|S|tdfkrnt}nt|dst 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&((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRas  cKs|jdd}|r1td|jnt||}|tkrP|S|tdfkrnt}nt|dst 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/RR0R1RR2R3RR4R5R (R$R+R6R-R&((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRqs  cCs)tt|}|tj|d<|S(Ni(RttypeRtpointer(R&tnew_obj((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRscCst|tjrt||St|tjr]|jtjkrPt||St||St |}yt |}Wnqt k rg|j D]}|d^q}t d|D}d|j}t |tf|}t |st Synchronized(R'Rt _SimpleCDataR=Rt_type_tc_chartSynchronizedStringtSynchronizedArrayR7t class_cachetKeyErrort_fields_tdictt__name__tSynchronizedBase(R&R-tclstsclstfieldtnamesRt classname((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyR s       !cCsXt|t|tjr8t|j|j|jffStt||jdffSdS(N( RR'RRRR?t_wrappert_length_R7R(R&((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyt reduce_ctypes cCsK|dk r||}ntj|t|j|j}||_|S(N(RRtregisterRPt from_addresst get_addressRN(RRtlengthR&((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRs    cBsPy e|SWn=ek rKi}e|fd|U||e|<||SXdS(Ni(t prop_cacheRDttemplate(R<R((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyR:s  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) RHcBs8eZddZdZdZdZdZRS(cCs=||_|pt|_|jj|_|jj|_dS(N(t_objRt_lockR.trelease(tselfR&R-((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyR#s cCs t|t|j|jffS(N(RR RWRX(RZ((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyt __reduce__s cCs|jS(N(RW(RZ((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pytget_objscCs|jS(N(RX(RZ((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pytget_lockscCsdt|j|jfS(Ns<%s wrapper for %s>(R7RGRW(RZ((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyt__repr__sN(RGt __module__RR#R[R\R]R^(((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyRHs     R=cBseZedZRS(tvalue(RGR_R:R`(((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyR=sRBcBs5eZdZdZdZdZdZRS(cCs t|jS(N(R*RW(RZ((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyt__len__scCs+|jz|j|SWd|jXdS(N(R.RWRY(RZR((s4/usr/lib64/python2.7/multiprocessing/sharedctypes.pyt __getitem__s cCs-|jz||j|#sB              "