
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3

  \þ  ã               @   sx   d Z dddddddgZdZeZi fd
d„Zdd„ Zdd„ Zdd„ Zddd„Z	dd„ Z
G dd„ deƒZdadadd„ ZdS )a/  Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

ÚerrorÚstart_new_threadÚexitÚ	get_identÚallocate_lockÚinterrupt_mainÚLockTypeé   é   c             C   sŠ   t |ƒt tƒ ƒkrtdƒ‚t |ƒt tƒ ƒkr4tdƒ‚day| ||Ž W n. tk
rZ   Y n   ddl}|jƒ  Y nX datr†dat	‚dS )aæ  Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    z2nd arg must be a tuplez3rd arg must be a dictFé    NT)
ÚtypeÚtupleÚ	TypeErrorÚdictÚ_mainÚ
SystemExitÚ	tracebackÚ	print_excÚ
_interruptÚKeyboardInterrupt)ZfunctionÚargsÚkwargsr   © r   ú%/usr/lib64/python3.6/_dummy_thread.pyr      s     c               C   s   t ‚dS )z'Dummy implementation of _thread.exit().N)r   r   r   r   r   r   =   s    c               C   s   dS )zôDummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    é   éÿÿÿÿr   r   r   r   r   r   A   s    c               C   s   t ƒ S )z0Dummy implementation of _thread.allocate_lock().)r   r   r   r   r   r   J   s    Nc             C   s   | dk	rt dƒ‚dS )z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr
   )r   )Úsizer   r   r   Ú
stack_sizeN   s    r   c               C   s   t ƒ S )z0Dummy implementation of _thread._set_sentinel().)r   r   r   r   r   Ú_set_sentinelT   s    r   c               @   sF   e Zd ZdZdd„ Zddd„ZeZdd	„ Zd
d„ Zdd„ Z	dd„ Z
dS )r   a�  Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    c             C   s
   d| _ d S )NF)Úlocked_status)Úselfr   r   r   Ú__init__c   s    zLockType.__init__Nr   c             C   sH   |dks|rd| _ dS | j s&d| _ dS |dkr@ddl}|j|ƒ dS dS )a©  Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        NTr
   F)r   ÚtimeZsleep)r   ZwaitflagZtimeoutr!   r   r   r   Úacquiref   s    
zLockType.acquirec             C   s   | j ƒ  d S )N)Úrelease)r   ÚtypÚvalÚtbr   r   r   Ú__exit__€   s    zLockType.__exit__c             C   s   | j s
t‚d| _ dS )zRelease the dummy lock.FT)r   r   )r   r   r   r   r#   ƒ   s    zLockType.releasec             C   s   | j S )N)r   )r   r   r   r   ÚlockedŒ   s    zLockType.lockedc             C   s*   d| j rdnd| jj| jjtt| ƒƒf S )Nz<%s %s.%s object at %s>r(   Zunlocked)r   Ú	__class__Ú
__module__Ú__qualname__ÚhexÚid)r   r   r   r   Ú__repr__�   s
    zLockType.__repr__r   )Nr   )Ú__name__r*   r+   Ú__doc__r    r"   Ú	__enter__r'   r#   r(   r.   r   r   r   r   r   X   s   	
	FTc               C   s   t r
t‚ndadS )z^Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.TN)r   r   r   r   r   r   r   r   œ   s    l        )N)r0   Ú__all__ÚTIMEOUT_MAXÚRuntimeErrorr   r   r   r   r   r   r   Úobjectr   r   r   r   r   r   r   r   Ú<module>   s   
 	
@