
    JTh                     h    S SK rS SKJr  SSKJr  S r " S S\R                  R                  5      rg)    N   )SimpleQueuec                  l    SS K n[        R                  R                  " U 0 UD6  UR	                  5         g )Nr   )gcmultiprocessingpoolworkercollect)argskwargsr   s      R/var/www/auris/envauris/lib/python3.13/site-packages/torch/multiprocessing/pool.pyclean_workerr      s)    00 JJL    c                   $    \ rS rSrSrS rS rSrg)Pool   zPool implementation which uses our version of SimpleQueue.

This lets us pass tensors in shared memory across processes instead of
serializing the underlying data.
c                     [        5       U l        [        5       U l        U R                  R                  R                  U l        U R                  R                  R                  U l        g )N)	r   _inqueue	_outqueue_writersend
_quick_put_readerrecv
_quick_get)selfs    r   _setup_queuesPool._setup_queues   sB    #$--//44..0055r   c                    [        U R                  [        U R                  5      -
  5       H  nU R                  U R
                  U R                  U R                  U R                  4n[        U S5      (       a  X R                  4-  nU R                  [        US9nU R                  R                  U5        UR                  R                  SS5      Ul        SUl        UR#                  5         [$        R&                  " S5        M     g)zIncrease the number of pool processes to the specified number.

Bring the number of pool processes up to the specified number, for use after
reaping workers which have exited.
_wrap_exception)targetr   Process
PoolWorkerTzadded workerN)range
_processeslen_poolr   r   _initializer	_initargs_maxtasksperchildhasattrr    r"   r   appendnamereplacedaemonstartutildebug)r   _r   ws       r   _repopulate_poolPool._repopulate_pool   s     tTZZ89A !!&&D t.//--//Lt<AJJa VV^^I|<AFAHGGIJJ~&! :r   )r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r5   __static_attributes__ r   r   r   r      s    6'r   r   )	multiprocessing.poolr   multiprocessing.utilr1   queuer   r   r   r   r=   r   r   <module>rA      s+     # #'?$$ #'r   