wQc@sddlZddlZddlZddlZddlmZmZddddddgZd Zdd l m Z de fd YZ d Z e j ee je d Ze j eejee j eejeyddlmZWnek rn#XdZdZe j eeejdkrddlZejZejZej Z de!fdYZ"n}ddl#Z#ddl$Z$ddl%Z%ddlZddl&m'Z'm(Z(m)Z)ddlm*Z*ddl m+Z+m,Z,ddZ.dZ/ejdko%e0ede1Z2ej3j4j5dZ6e'j7Ze'j8Z e6rsej9j:ej;da<n ej3a<dZ=de1dZde!fdYZ"dZ>d Z?d!Z@d"ZAd#ZBd$ZCe j e(eCe j e)eCgZDd%ZEdS(&iN(tutiltprocesstPopentassert_spawningtexitt duplicatetclosetForkingPicklercCs,tjs(tdt|jndS(NsF%s objects should only be shared between processes through inheritance(Rtthread_is_spawningt RuntimeErrorttypet__name__(tself((s-/sys/lib/python2.7/multiprocessing/forking.pyR0s (tPicklercBs&eZejjZedZRS(cs fd}||j|siitwb(R1tpipeRtmsvcrtt get_osfhandleR;Rtget_command_linetjoinRft CreateProcessRcRtCloseR3R0t_handletget_preparation_datat_nametfdopentintRt_tlstprocess_handleR_R^( R R8trfdtwfdtrhandletcmdthpthtR3ttidt prep_datatto_child((s-/sys/lib/python2.7/multiprocessing/forking.pyR:s( -      cCsttjdddk S(NR(RRR~R(((s-/sys/lib/python2.7/multiprocessing/forking.pyRscCst|tjjS(N(RRR~R(Rk((s-/sys/lib/python2.7/multiprocessing/forking.pytduplicate_for_childscCs|jdkr|dkr'tj}ntdt|dd}tjt|j|}|tjkrtj |j}|t krt j }n||_qn|jS(Niig?( R0RRftINFINITEtmaxR}tWaitForSingleObjectRyt WAIT_OBJECT_0tGetExitCodeProcesst TERMINATERSRT(R RLtmsecsROR9((s-/sys/lib/python2.7/multiprocessing/forking.pyRQ"s    cCs|jddS(NRLi(RQ(R ((s-/sys/lib/python2.7/multiprocessing/forking.pyRH2scCse|jdkraytjt|jtWqatk r]|jdddkr^q^qaXndS(NRLg?( R0RRftTerminateProcessR}RyRt WindowsErrorRQ(R ((s-/sys/lib/python2.7/multiprocessing/forking.pyRV5s  N(R Rt__doc__tthreadt_localR~R:RYRRRRQRHRV(((s-/sys/lib/python2.7/multiprocessing/forking.pyRs  !  cCsFt|dkr>|ddkr>t|dks:ttStSdS(sE Return whether commandline indicates we are forking iis--multiprocessing-forkiN(tlenRCR;RW(targv((s-/sys/lib/python2.7/multiprocessing/forking.pyt is_forkingAs"cCs'ttjr#ttjndS(sM Run code for process object if this in not the main process N(RR,RtmainR(((s-/sys/lib/python2.7/multiprocessing/forking.pytfreeze_supportLscCstttjdtr'tdnttdtrFtjdgSd}tj}t g|d|dgSdS(sR Returns prefix of command line used for spawning a child process t _inheritings Attempt to start a new process before the current process has finished its bootstrapping phase. This probably means that you are on Windows and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce a Windows executable.Rbs--multiprocessing-forks0from multiprocessing.forking import main; main()s-cN( RRtcurrent_processRWR R,t executableRt_args_from_interpreter_flagsRc(tprogtopts((s-/sys/lib/python2.7/multiprocessing/forking.pyRuUs   cCsttjstttjd}tj|tj}tj |d}t t j _ t|}t|t|}tt j _ |j|j}t|dS(s> Run code specifed by data received over pipe itrbN(RR,RRCR}Rstopen_osfhandleR1tO_RDONLYR|R;RRRR]tprepareRWRR6R(Rktfdt from_parenttpreparation_dataR texitcode((s-/sys/lib/python2.7/multiprocessing/forking.pyRps     c Cs.ddlm}m}td|dtjdtjd|dtjdtj j }|dk rt|j |d tmultiprocessingRRt__all__RtpickleR RR RR tsaveR"tlistRR}t__add__t functoolsR#t ImportErrorR)R$tplatformRIR7RtdupRRtobjectRRRsRft_multiprocessingR*RZR[R\R]R^RR_RRRWRRtlowertendswithRt ExitProcesst CloseHandleRRvt exec_prefixRcReRRRuRRzRRR(((s-/sys/lib/python2.7/multiprocessing/forking.pyt#sn              G     !     N   "