U
    
W[É  ã                   @   s8   d Z ddlmZmZmZ ddlmZ G dd„ deƒZdS )zI
Common functionality used within the implementation of various workers.
é    )Úabsolute_importÚdivisionÚprint_functioné   )ÚAlreadyQuitc                   @   s(   e Zd ZdZdd„ Zdd„ Z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}
    c                 C   s
   d| _ dS )z*
        Create a L{Quit} un-set.
        FN)ÚisSet©Úself© r   ú?/usr/lib/python3/dist-packages/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.checkN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s   
r   N)	r   Z
__future__r   r   r   Z	_ithreadsr   Úobjectr   r   r   r   r   Ú<module>   s   