o
    i                     @   s8   d Z ddlmZ ddlmZ dZdZG dd deZdS )	Base class for threads.    )Thread)IOLoopControlzShell channelc                       s4   e Zd ZdZ fddZd
ddZd
dd	Z  ZS )
BaseThreadr   c                    s.   t  jdi | tdd| _d| _d| _dS )zInitialize the thread.F)make_currentTN )super__init__r   io_looppydev_do_not_traceis_pydev_daemon_thread)selfkwargs	__class__r   K/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/ipykernel/thread.pyr
      s   
zBaseThread.__init__returnNc                 C   s(   z| j   W | j   dS | j   w )zRun the thread.N)r   startcloser   r   r   r   run   s   zBaseThread.runc                 C   s   | j | j j dS )z=Stop the thread.

        This method is threadsafe.
        N)r   add_callbackstopr   r   r   r   r      s   zBaseThread.stop)r   N)__name__
__module____qualname____doc__r
   r   r   __classcell__r   r   r   r   r      s
    
r   N)r   	threadingr   tornado.ioloopr   CONTROL_THREAD_NAMESHELL_CHANNEL_THREAD_NAMEr   r   r   r   r   <module>   s    