o
    Zh.                     @   s4   d Z ddlmZ ddlmZ dZG dd deZdS )A thread for a control channel.    )Thread)IOLoopControlc                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	ControlThreadr   c                 K   s2   t j| fdti| tdd| _d| _d| _dS )zInitialize the thread.nameF)Zmake_currentTN)r   __init__CONTROL_THREAD_NAMEr   io_loopZpydev_do_not_traceZis_pydev_daemon_thread)selfkwargs r   H/var/www/html/lang_env/lib/python3.10/site-packages/ipykernel/control.pyr      s   
zControlThread.__init__c                 C   s.   t | _z| j  W | j  dS | j  w )zRun the thread.N)r	   r   r
   startcloser   r   r   r   run   s   zControlThread.runc                 C   s   | j | j j dS )z=Stop the thread.

        This method is threadsafe.
        N)r
   Zadd_callbackstopr   r   r   r   r      s   zControlThread.stopN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   	   s
    r   N)r   	threadingr   Ztornado.ioloopr   r	   r   r   r   r   r   <module>   s
    