Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/context.cpython-311.opt-1.pyc
�

�,dM-��0�ddlZddlZddlZddlmZddlmZdZGd�de��ZGd�d	e��Z	Gd
�de��Z
Gd�d
e��ZGd�de��Z
Gd�dej��ZGd�de
��Zejdkr�Gd�dej��ZGd�dej��ZGd�dej��ZGd�de
��ZGd�de
��ZGd�d e
��Ze��e��e��d!�Zejd"kreed#��ZnPeed$��Zn>Gd%�dej��ZGd&�de
��Zd#e��iZeed#��Zd'�Zej��Zd(�Zd)�Zd*�ZdS)+�N�)�process)�	reduction�c��eZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__r��>/opt/alt/python311/lib64/python3.11/multiprocessing/context.pyrr��������Dr
rc��eZdZdS)�BufferTooShortNr	rr
rrrrr
rc��eZdZdS)�TimeoutErrorNr	rr
rrrrr
rc��eZdZdS)�AuthenticationErrorNr	rr
rrrrr
rc��eZdZeZeZeZeZeej	��Z	eej
��Z
eej��Zd�Zd�Z
d&d�Zd�Zd�Zd'd�Zd(d
�Zd(d�Zd�Zd)d
�Zd*d�Zd*d�Zd�Z		d+d�Zd�Zd�Zdd�d�Zdd�d�Zd�Zd�Zd'd�Z d�Z!d�Z"d�Z#d'd�Z$d,d!�Z%d,d"�Z&e'd#���Z(e(j)d$���Z(d%�Z*dS)-�BaseContextc�N�tj��}|�td���|S)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�self�nums  rrzBaseContext.cpu_count)s&���l�n�n���;�%�&G�H�H�H��Jr
c�v�ddlm}||������}|���|S)z�Returns 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)�SyncManager��ctx)�managersr�get_context�start)rr�ms   r�ManagerzBaseContext.Manager1sF��	*�)�)�)�)�)��K�D�,�,�.�.�/�/�/��	���	�	�	��r
Tc�$�ddlm}||��S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr()r�duplexr(s   rr(zBaseContext.Pipe<s"��$�$�$�$�$�$��t�F�|�|�r
c�J�ddlm}||������S)z#Returns a non-recursive lock objectr)�Lockr )�synchronizer,r#)rr,s  rr,zBaseContext.LockAs3��%�%�%�%�%�%��t��(�(�*�*�+�+�+�+r
c�J�ddlm}||������S)zReturns a recursive lock objectr)�RLockr )r-r/r#)rr/s  rr/zBaseContext.RLockF�3��&�&�&�&�&�&��u��)�)�+�+�,�,�,�,r
Nc�L�ddlm}|||������S)zReturns a condition objectr)�	Conditionr )r-r2r#)r�lockr2s   rr2zBaseContext.ConditionKs5��*�*�*�*�*�*��y��4�#3�#3�#5�#5�6�6�6�6r
rc�L�ddlm}|||������S)zReturns a semaphore objectr)�	Semaphorer )r-r5r#)r�valuer5s   rr5zBaseContext.SemaphorePs5��*�*�*�*�*�*��y��D�$4�$4�$6�$6�7�7�7�7r
c�L�ddlm}|||������S)z"Returns a bounded semaphore objectr)�BoundedSemaphorer )r-r8r#)rr6r8s   rr8zBaseContext.BoundedSemaphoreUs6��1�1�1�1�1�1����4�+;�+;�+=�+=�>�>�>�>r
c�J�ddlm}||������S)zReturns an event objectr)�Eventr )r-r:r#)rr:s  rr:zBaseContext.EventZr0r
c�P�ddlm}|||||������S)zReturns a barrier objectr)�Barrierr )r-r<r#)r�parties�action�timeoutr<s     rr<zBaseContext.Barrier_s9��(�(�(�(�(�(��w�w���T�5E�5E�5G�5G�H�H�H�Hr
rc�L�ddlm}|||������S)�Returns a queue objectr)�Queuer )�queuesrBr#)r�maxsizerBs   rrBzBaseContext.Queueds5��!�!�!�!�!�!��u�W�$�"2�"2�"4�"4�5�5�5�5r
c�L�ddlm}|||������S)rAr)�
JoinableQueuer )rCrFr#)rrDrFs   rrFzBaseContext.JoinableQueueis5��)�)�)�)�)�)��}�W�$�*:�*:�*<�*<�=�=�=�=r
c�J�ddlm}||������S)rAr)�SimpleQueuer )rCrHr#)rrHs  rrHzBaseContext.SimpleQueuens3��'�'�'�'�'�'��{�t�/�/�1�1�2�2�2�2r
rc�R�ddlm}||||||������S)zReturns a process pool objectr)�Pool)�context)�poolrJr#)r�	processes�initializer�initargs�maxtasksperchildrJs      rrJzBaseContext.PoolssG��	�������t�I�{�H�6F� �,�,�.�.�0�0�0�	0r
c� �ddlm}||g|�R�S)zReturns a shared objectr)�RawValue)�sharedctypesrR)r�typecode_or_type�argsrRs    rrRzBaseContext.RawValuezs-��*�*�*�*�*�*��x�(�0�4�0�0�0�0r
c�&�ddlm}|||��S)zReturns a shared arrayr)�RawArray)rSrW)rrT�size_or_initializerrWs    rrWzBaseContext.RawArrays(��*�*�*�*�*�*��x�(�*=�>�>�>r
)r3c�L�ddlm}||g|�R||���d��S)z$Returns a synchronized shared objectr)�Value�r3r!)rSrZr#)rrTr3rUrZs     rrZzBaseContext.Value�sR��'�'�'�'�'�'��u�%�-��-�-�4��)�)�+�+�-�-�-�	-r
c�P�ddlm}|||||������S)z#Returns a synchronized shared arrayr)�Arrayr[)rSr]r#)rrTrXr3r]s     rr]zBaseContext.Array�sD��'�'�'�'�'�'��u�%�':���)�)�+�+�-�-�-�	-r
c�z�tjdkr(ttdd��rddlm}|��dSdSdS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32�frozenFr)�freeze_supportN)�sys�platform�getattr�spawnra)rras  rrazBaseContext.freeze_support�sV���<�7�"�"�w�s�H�e�'D�'D�"�-�-�-�-�-�-��N������#�"�"�"r
c�"�ddlm}|��S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrg)rrgs  rrgzBaseContext.get_logger�s"��	%�$�$�$�$�$��z�|�|�r
c�$�ddlm}||��S)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rhrj)r�levelrjs   rrjzBaseContext.log_to_stderr�s$��'�'�'�'�'�'��}�U�#�#�#r
c��ddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)r)N)�r))rr)s  r�allow_connection_picklingz%BaseContext.allow_connection_pickling�s��	!� � � � � � � r
c�(�ddlm}||��dS)z�Sets 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)rerp)r�
executablerps   rrpzBaseContext.set_executable�s,��
	*�)�)�)�)�)���z�"�"�"�"�"r
c�(�ddlm}||��dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrs)r�module_namesrss   rrsz"BaseContext.set_forkserver_preload�s-��	7�6�6�6�6�6���|�,�,�,�,�,r
c��|�|S	t|}n!#t$rtd|z��d�wxYw|���|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodr!s   rr#zBaseContext.get_context�sj���>��K�	N�$�V�,�C�C���	N�	N�	N��9�F�B�C�C��M�	N�����������
s�
�2Fc��|jS�N)�_name�r�
allow_nones  r�get_start_methodzBaseContext.get_start_method�s
���z�r
c� �td���)Nz+cannot set start method of concrete context)ry�rr{�forces   r�set_start_methodzBaseContext.set_start_method�s���F�G�G�Gr
c�D�t���d��S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globals�get�rs r�reducerzBaseContext.reducer�s���y�y�}�}�[�)�)�)r
c�(�|t��d<dS)Nr)r�)rrs  rr�zBaseContext.reducer�s��!*��	�	�+���r
c��dSr}rr�s rrzzBaseContext._check_available�s���r
)Tr})r)NN)r)NNrN�F)+r
rrrrrr�staticmethodr�current_process�parent_process�active_childrenrr&r(r,r/r2r5r8r:r<rBrFrHrJrRrWrZr]rargrjrnrprsr#r�r��propertyr��setterrzrr
rrrs��������L�#�N��L�-��"�l�7�#:�;�;�O�!�\�'�"8�9�9�N�"�l�7�#:�;�;�O����	�	�	�����
,�,�,�
-�-�-�
7�7�7�7�
8�8�8�8�
?�?�?�?�
-�-�-�
I�I�I�I�
6�6�6�6�
>�>�>�>�
3�3�3�
?A�"�0�0�0�0�1�1�1�
?�?�?�
37�-�-�-�-�-�DH�-�-�-�-�-�������$�$�$�$�
!�!�!�#�#�#�-�-�-���������H�H�H�H��*�*��X�*�

�^�+�+��^�+�
�
�
�
�
r
rc�>�eZdZdZed���Zed���ZdS)�ProcessNc�d�t���j�|��Sr})�_default_contextr#r��_Popen)�process_objs rr�zProcess._Popen�s%���+�+�-�-�5�<�<�[�I�I�Ir
c�b�t���j���Sr})r�r#r��_after_forkrr
rr�zProcess._after_fork�s#���+�+�-�-�5�A�A�C�C�Cr
�r
rr�
_start_methodr�r�r�rr
rr�r��sU�������M��J�J��\�J��D�D��\�D�D�Dr
r�c�@��eZdZeZd�Zd�fd�	Zd	d�Zd	d�Zd�Z�xZ	S)
�DefaultContextc�"�||_d|_dSr})r��_actual_context)rrKs  r�__init__zDefaultContext.__init__�s�� '���#����r
Nc�~��|�|j�|j|_|jSt���|��Sr})r�r��superr#)rr{�	__class__s  �rr#zDefaultContext.get_context�s=����>��#�+�'+�'<��$��'�'��7�7�&�&�v�.�.�.r
Fc��|j�|std���|�|r	d|_dS|�|��|_dS)Nzcontext has already been set)r��RuntimeErrorr#r�s   rr�zDefaultContext.set_start_method�sQ����+�E�+��=�>�>�>��>�e�>�#'�D� ��F�#�/�/��7�7����r
c�H�|j�|rdS|j|_|jjSr})r�r�r~rs  rr�zDefaultContext.get_start_method�s/����'��
��t�#'�#8�D� ��#�)�)r
c��tjdkrdgStjdkrddgnddg}tjr|�d��|S)Nr_re�darwin�forkrt)rbrcr�HAVE_SEND_HANDLE�append)r�methodss  r�get_all_start_methodsz$DefaultContext.get_all_start_methodssZ���<�7�"�"��9��+.�<�8�+C�+C�w��'�'�&�RY�IZ�G��)�
-����|�,�,�,��Nr
r}r�)
r
rrr�r�r#r�r�r��
__classcell__)r�s@rr�r��s���������G�$�$�$�/�/�/�/�/�/�8�8�8�8�*�*�*�*�������r
r�r_c�(�eZdZdZed���ZdS)�ForkProcessr�c�$�ddlm}||��S�Nr)�Popen)�
popen_forkr��r�r�s  rr�zForkProcess._Popens$��)�)�)�)�)�)��5��%�%�%r
N�r
rrr�r�r�rr
rr�r�s2�������
�	�	&�	&�
��	&�	&�	&r
r�c�>�eZdZdZed���Zed���ZdS)�SpawnProcessrec�$�ddlm}||��Sr�)�popen_spawn_posixr�r�s  rr�zSpawnProcess._Popen�$��0�0�0�0�0�0��5��%�%�%r
c��dSr}rrr
rr�zSpawnProcess._after_fork"�	��
�Dr
Nr�rr
rr�r��M�������
�	�	&�	&�
��	&�
�	�	�
��	�	�	r
r�c�(�eZdZdZed���ZdS)�ForkServerProcessrtc�$�ddlm}||��Sr�)�popen_forkserverr�r�s  rr�zForkServerProcess._Popen)s$��/�/�/�/�/�/��5��%�%�%r
Nr�rr
rr�r�'s2������$�
�	�	&�	&�
��	&�	&�	&r
r�c��eZdZdZeZdS)�ForkContextr�N)r
rrr~r�r�rr
rr�r�.s�����������r
r�c��eZdZdZeZdS��SpawnContextreN�r
rrr~r�r�rr
rr�r�2������������r
r�c��eZdZdZeZd�ZdS)�ForkServerContextrtc�<�tjstd���dS)Nz%forkserver start method not available)rr�ryr�s rrzz"ForkServerContext._check_available9s)���-�
J� �!H�I�I�I�
J�
Jr
N)r
rrr~r�r�rzrr
rr�r�6s2��������#��	J�	J�	J�	J�	Jr
r�)r�rertr�rer�c�>�eZdZdZed���Zed���ZdS)r�rec�$�ddlm}||��Sr�)�popen_spawn_win32r�r�s  rr�zSpawnProcess._PopenMr�r
c��dSr}rrr
rr�zSpawnProcess._after_forkRr�r
Nr�rr
rr�r�Kr�r
c��eZdZdZeZdSr�r�rr
rr�r�Wr�r
c�4�t|t_dSr})rwr�r�)r{s r�_force_start_methodr�ds��'9�&�'A��$�$�$r
c�.�ttdd��S)N�spawning_popen)rd�_tlsrr
r�get_spawning_popenr�ms���4�)�4�0�0�0r
c��|t_dSr})r�r�)�popens r�set_spawning_popenr�ps���D���r
c�j�t���$tdt|��jz���dS)NzF%s objects should only be shared between processes through inheritance)r�r��typer
)�objs r�assert_spawningr�ss>�����#��
#�%)�#�Y�Y�%7�
8���	�$�#r
) rrb�	threadingrmrr�__all__�	Exceptionrrrr�objectr�BaseProcessr�r�rcr�r�r�r�r�r�rwr�r��localr�r�r�r�rr
r�<module>r�s���	�	�	�	�
�
�
�
�����������������
��	�	�	�	�	�9�	�	�	�	�	�	�	�	�\�	�	�	�	�	�	�	�	�<�	�	�	�	�	�	�	�	�,�	�	�	�x
�x
�x
�x
�x
�&�x
�x
�x
�|D�D�D�D�D�g�!�D�D�D�%�%�%�%�%�[�%�%�%�X�<�7���&�&�&�&�&�g�)�&�&�&�
�
�
�
�
�w�*�
�
�
�&�&�&�&�&�G�/�&�&�&������k���������{����J�J�J�J�J�K�J�J�J���
�
�����'�'�)�)����
�|�x���*�>�*<�W�*E�F�F���)�>�*<�V�*D�E�E���
�
�
�
�
�w�*�
�
�
������{����
	�������&�~�&8��&A�B�B��B�B�B��y�����1�1�1� � � �����r

ZeroDay Forums Mini