
    oi                     >    d Z ddlmZ ddlmZ dZdZ G d de      Zy)	Base class for threads.    )Thread)IOLoopControlzShell channelc                   2     e Zd ZdZ fdZddZddZ xZS )
BaseThreadr   c                 b    t        |   di | t        d      | _        d| _        d| _        y)zInitialize the thread.F)make_currentTN )super__init__r   io_looppydev_do_not_traceis_pydev_daemon_thread)selfkwargs	__class__s     X/home/ubuntu/docker-apps/notebooks/venv/lib/python3.12/site-packages/ipykernel/thread.pyr   zBaseThread.__init__   s/    "6"51"&&*#    c                     	 | j                   j                          | j                   j                          y# | j                   j                          w xY w)zRun the thread.N)r   startcloser   s    r   runzBaseThread.run   s8    	!LL LL DLL s	   7 Ac                 b    | j                   j                  | j                   j                         y)z=Stop the thread.

        This method is threadsafe.
        N)r   add_callbackstopr   s    r   r   zBaseThread.stop   s     
 	!!$,,"3"34r   )returnN)__name__
__module____qualname____doc__r   r   r   __classcell__)r   s   @r   r   r      s    !+!5r   r   N)r"   	threadingr   tornado.ioloopr   CONTROL_THREAD_NAMESHELL_CHANNEL_THREAD_NAMEr   r   r   r   <module>r(      s&      ! + 5 5r   