U
    ˆj–  ã                   @   s"   d Z ddlmZ G dd„ dƒZdS )zI
Common functionality used within the implementation of various workers.
é   )ÚAlreadyQuitc                   @   s:   e Zd ZdZddœdd„Zddœdd„Zddœdd	„ZdS )
ÚQuitz‚
    A flag representing whether a worker has been quit.

    @ivar isSet: Whether this flag is set.
    @type isSet: L{bool}
    N)Úreturnc                 C   s
   d| _ dS )z*
        Create a L{Quit} un-set.
        FN)ÚisSet©Úself© r   úA/tmp/pip-unpacked-wheel-j5h_c8_q/twisted/_threads/_convenience.pyÚ__init__   s    zQuit.__init__c                 C   s   |   ¡  d| _dS )zg
        Set the flag if it has not been set.

        @raise AlreadyQuit: If it has been set.
        TN)Úcheckr   r   r   r   r	   Úset   s    zQuit.setc                 C   s   | j rtƒ ‚dS )zb
        Check if the flag has been set.

        @raise AlreadyQuit: If it has been set.
        N)r   r   r   r   r   r	   r   $   s    z
Quit.check)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r   r	   r      s   	r   N)r   Z	_ithreadsr   r   r   r   r   r	   Ú<module>   s   