Hacked By AnonymousFox

Current Path : /opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/context.cpython-312.opt-2.pyc

�

�Q�f�-����ddlZddlZddlZddlmZddlmZdZGd�de�ZGd�d	e�Z	Gd
�de�Z
Gd�d
e�ZGd�de�Z
Gd�dej�ZGd�de
�Zej"dk7r�Gd�dej�ZGd�dej�ZGd�dej�ZGd�de
�ZGd�de
�ZGd�d e
�Ze�e�e�d!�Zej"d"k(reed#�Zn@eed$�Zn4Gd%�dej�ZGd&�de
�Zd#e�iZeed#�Zd'�Zej6�Zd(�Zd)�Zd*�Zy)+�N�)�process)�	reduction�c��eZdZy)�ProcessErrorN��__name__�
__module__�__qualname__r��>/opt/alt/python312/lib64/python3.12/multiprocessing/context.pyrr���r
rc��eZdZy)�BufferTooShortNr	rr
rrrrr
rc��eZdZy)�TimeoutErrorNr	rr
rrrrr
rc��eZdZy)�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(jRd ��Z(d!�Z*y))�BaseContextc�J�	tj�}|�td��|S)Nzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�self�nums  rrzBaseContext.cpu_count)s&��6��l�l�n���;�%�&G�H�H��Jr
c�b�	ddlm}||j���}|j�|S)Nr)�SyncManager��ctx)�managersr�get_context�start)rr�ms   r�ManagerzBaseContext.Manager1s-��	�
	*��D�,�,�.�/��	���	��r
Tc� �	ddlm}||�S)Nr)�Pipe)�
connectionr()r�duplexr(s   rr(zBaseContext.Pipe<s��?�$��F�|�r
c�>�	ddlm}||j���S)Nr)�Lockr )�synchronizer,r#)rr,s  rr,zBaseContext.LockAs��1�%���(�(�*�+�+r
c�>�	ddlm}||j���S)Nr)�RLockr )r-r/r#)rr/s  rr/zBaseContext.RLockFs��-�&���)�)�+�,�,r
Nc�@�	ddlm}|||j���S)Nr)�	Conditionr )r-r1r#)r�lockr1s   rr1zBaseContext.ConditionKs��(�*���4�#3�#3�#5�6�6r
c�@�	ddlm}|||j���S)Nr)�	Semaphorer )r-r4r#)r�valuer4s   rr4zBaseContext.SemaphorePs��(�*���D�$4�$4�$6�7�7r
c�@�	ddlm}|||j���S)Nr)�BoundedSemaphorer )r-r7r#)rr5r7s   rr7zBaseContext.BoundedSemaphoreUs��0�1���4�+;�+;�+=�>�>r
c�>�	ddlm}||j���S)Nr)�Eventr )r-r9r#)rr9s  rr9zBaseContext.EventZs��%�&���)�)�+�,�,r
c�D�	ddlm}|||||j���S)Nr)�Barrierr )r-r;r#)r�parties�action�timeoutr;s     rr;zBaseContext.Barrier_s"��&�(��w���T�5E�5E�5G�H�Hr
c�@�	ddlm}|||j���S)Nr)�Queuer )�queuesr@r#)r�maxsizer@s   rr@zBaseContext.Queueds��$�!��W�$�"2�"2�"4�5�5r
c�@�	ddlm}|||j���S)Nr)�
JoinableQueuer )rArDr#)rrBrDs   rrDzBaseContext.JoinableQueueis��$�)��W�$�*:�*:�*<�=�=r
c�>�	ddlm}||j���S)Nr)�SimpleQueuer )rArFr#)rrFs  rrFzBaseContext.SimpleQueuens��$�'��t�/�/�1�2�2r
c�F�	ddlm}||||||j���S)Nr)�Pool)�context)�poolrHr#)r�	processes�initializer�initargs�maxtasksperchildrHs      rrHzBaseContext.Poolss*��+���I�{�H�6F� �,�,�.�0�	0r
c�"�	ddlm}||g|���S)Nr)�RawValue)�sharedctypesrP)r�typecode_or_type�argsrPs    rrPzBaseContext.RawValuezs��%�*��(�0�4�0�0r
c�"�	ddlm}|||�S)Nr)�RawArray)rQrU)rrR�size_or_initializerrUs    rrUzBaseContext.RawArrays��$�*��(�*=�>�>r
)r2c�F�	ddlm}||g|��||j�d��S)Nr)�Value�r2r!)rQrXr#)rrRr2rSrXs     rrXzBaseContext.Value�s2��2�'��%�-��-�4��)�)�+�-�	-r
c�D�	ddlm}|||||j���S)Nr)�ArrayrY)rQr[r#)rrRrVr2r[s     rr[zBaseContext.Array�s)��1�'��%�':���)�)�+�-�	-r
c�l�	tjdk(r ttdd�rddlm}|�yyy)N�win32�frozenFr)�freeze_support)�sys�platform�getattr�spawnr_)rr_s  rr_zBaseContext.freeze_support�s2��	��<�<�7�"�w�s�H�e�'D�-���(E�"r
c��	ddlm}|�S)Nr)�
get_logger)�utilre)rres  rrezBaseContext.get_logger�s��	�	%��|�r
c� �	ddlm}||�S)Nr)�
log_to_stderr)rfrh)r�levelrhs   rrhzBaseContext.log_to_stderr�s��F�'��U�#�#r
c��	ddlm}y)Nr)r))�r))rr)s  r�allow_connection_picklingz%BaseContext.allow_connection_pickling�s��	�
	!r
c�"�	ddlm}||�y)Nr)�set_executable)rcrn)r�
executablerns   rrnzBaseContext.set_executable�s��	�	*��z�"r
c�"�	ddlm}||�y)Nr)�set_forkserver_preload)�
forkserverrq)r�module_namesrqs   rrqz"BaseContext.set_forkserver_preload�s��	�	7��|�,r
c�z�|�|S	t|}|j�|S#t$rtd|z�d�wxYw)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodr!s   rr#zBaseContext.get_context�sU���>��K�	N�$�V�,�C�	�����
���	N��9�F�B�C��M�	N�s�	!�:c��|jS�N)�_name�r�
allow_nones  r�get_start_methodzBaseContext.get_start_method�s���z�z�r
c��td��)Nz+cannot set start method of concrete context)rw�rry�forces   r�set_start_methodzBaseContext.set_start_method�s���F�G�Gr
c�6�	t�jd�S�Nr)�globals�get�rs r�reducerzBaseContext.reducer�s��	(��y�}�}�[�)�)r
c��|t�d<yr�)r�)rrs  rr�zBaseContext.reducer�s��!*��	�+�r
c��yr{rr�s rrxzBaseContext._check_available�s��r
)Tr{)r)NN)r)NNrN�F)+r
rrrrrr�staticmethodr�current_process�parent_process�active_childrenrr&r(r,r/r1r4r7r9r;r@rDrFrHrPrUrXr[r_rerhrlrnrqr#rr��propertyr��setterrxrr
rrrs���L�#�N��L�-��"�7�#:�#:�;�O�!�'�"8�"8�9�N�"�7�#:�#:�;�O��	��
,�
-�
7�
8�
?�
-�
I�
6�
>�
3�
?A�"�0�1�
?�
37�-�DH�-���$�
!�#�-���H��*��*�

�^�^�+��+�
r
rc�0�eZdZdZed��Zed��Zy)�ProcessNc�\�tj�jj|�Sr{)�_default_contextr#r��_Popen)�process_objs rr�zProcess._Popen�s"���+�+�-�5�5�<�<�[�I�Ir
c�Z�tj�jj�Sr{)r�r#r��_after_forkrr
rr�zProcess._after_fork�s ���+�+�-�5�5�A�A�C�Cr
�r
rr�
_start_methodr�r�r�rr
rr�r��s1���M��J��J��D��Dr
r�c�@��eZdZeZd�Zd�fd�	Zdd�Zdd�Zd�Z�xZ	S)�DefaultContextc� �||_d|_yr{)r��_actual_context)rrIs  r�__init__zDefaultContext.__init__�s�� '���#��r
c�x��|�)|j�|j|_|jSt�|�
|�Sr{)r�r��superr#)rry�	__class__s  �rr#zDefaultContext.get_context�s>����>��#�#�+�'+�'<�'<��$��'�'�'��7�&�v�.�.r
c�z�|j�
|std��|�
|rd|_y|j|�|_y)Nzcontext has already been set)r��RuntimeErrorr#r�s   rr�zDefaultContext.set_start_method�sA�����+�E��=�>�>��>�e�#'�D� ��#�/�/��7��r
c�n�|j�|ry|j|_|jjSr{)r�r�r|r}s  rrzDefaultContext.get_start_method�s4�����'���#'�#8�#8�D� ��#�#�)�)�)r
c��	tjdk(rdgStjdk(rddgnddg}tjr|j	d�|S)Nr]rc�darwin�forkrr)r`rar�HAVE_SEND_HANDLE�append)r�methodss  r�get_all_start_methodsz$DefaultContext.get_all_start_methodssP��K��<�<�7�"��9��+.�<�<�8�+C�w��'�&�RY�IZ�G��)�)����|�,��Nr
r{r�)
r
rrr�r�r#r�rr��
__classcell__)r�s@rr�r��s!����G�$�/�8�*�r
r�r]c� �eZdZdZed��Zy)�ForkProcessr�c��ddlm}||�S�Nr)�Popen)�
popen_forkr��r�r�s  rr�zForkProcess._Popens��)���%�%r
N�r
rrr�r�r�rr
rr�r�s���
�	�	&�
�	&r
r�c�0�eZdZdZed��Zed��Zy)�SpawnProcessrcc��ddlm}||�Sr�)�popen_spawn_posixr�r�s  rr�zSpawnProcess._Popen���0���%�%r
c��yr{rrr
rr�zSpawnProcess._after_fork#���
r
Nr�rr
rr�r��-���
�	�	&�
�	&�
�	�
�	r
r�c� �eZdZdZed��Zy)�ForkServerProcessrrc��ddlm}||�Sr�)�popen_forkserverr�r�s  rr�zForkServerProcess._Popen*s��/���%�%r
Nr�rr
rr�r�(s��$�
�	�	&�
�	&r
r�c��eZdZdZeZy)�ForkContextr�N)r
rrr|r�r�rr
rr�r�/s�����r
r�c��eZdZdZeZy��SpawnContextrcN�r
rrr|r�r�rr
rr�r�3������r
r�c��eZdZdZeZd�Zy)�ForkServerContextrrc�:�tjstd��y)Nz%forkserver start method not available)rr�rwr�s rrxz"ForkServerContext._check_available:s���-�-� �!H�I�I�.r
N)r
rrr|r�r�rxrr
rr�r�7s����#��	Jr
r�)r�rcrrr�rcr�c�0�eZdZdZed��Zed��Zy)r�rcc��ddlm}||�Sr�)�popen_spawn_win32r�r�s  rr�zSpawnProcess._PopenNr�r
c��yr{rrr
rr�zSpawnProcess._after_forkSr�r
Nr�rr
rr�r�Lr�r
c��eZdZdZeZyr�r�rr
rr�r�Xr�r
c�(�t|t_yr{)rur�r�)rys r�_force_start_methodr�es��'9�&�'A��$r
c�$�ttdd�S)N�spawning_popen)rb�_tlsrr
r�get_spawning_popenr�ns���4�)�4�0�0r
c��|t_yr{)r�r�)�popens r�set_spawning_popenr�qs
���D�r
c�Z�t��!tdt|�jz��y)NzF%s objects should only be shared between processes through inheritance)r�r��typer
)�objs r�assert_spawningr�ts4����#��
#�%)�#�Y�%7�%7�
8��	�$r
) rr`�	threadingrkrr�__all__�	Exceptionrrrr�objectr�BaseProcessr�r�rar�r�r�r�r�r�rur�r��localr�r�r�r�rr
r�<module>r�s���	�
����
��	�9�	�	�\�	�	�<�	�	�,�	�x
�&�x
�|D�g�!�!�D�&�[�&�Z�<�<�7��&�g�)�)�&�
�w�*�*�
�&�G�/�/�&��k���{��J�K�J��
���'�)���
�|�|�x��*�*<�W�*E�F��)�*<�V�*D�E��
�w�*�*�
��{��
	�����&�&8��&A�B��B��y�����1� �r

Hacked By AnonymousFox1.0, Coded By AnonymousFox