grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026î ¤ fã@s­dZdddddddgZdZeZid d„Zd d„Zd d„Zd d„Zddd„Z dd„Z Gdd„de ƒZ da dadd„ZdS)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 Cs¼t|ƒttƒƒkr*tdƒ‚nt|ƒttƒƒkrTtdƒ‚nday|||ŽWn/tk rYnddl}|jƒYnXdatr¸dat ‚ndS)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. z2nd arg must be a tuplez3rd arg must be a dictFéNT) ÚtypeÚtupleÚ TypeErrorÚdictÚ_mainÚ SystemExitÚ tracebackÚ print_excÚ _interruptÚKeyboardInterrupt)ZfunctionÚargsÚkwargsr©rú2/opt/alt/python34/lib64/python3.4/_dummy_thread.pyrs   cCs t‚dS)z'Dummy implementation of _thread.exit().N)rrrrrr=scCsdS)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. ééÿÿÿÿrrrrrrAscCstƒS)z0Dummy implementation of _thread.allocate_lock().)rrrrrrJsNcCs|dk rtdƒ‚ndS)z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr )r)ÚsizerrrÚ stack_sizeNs rcCstƒS)z0Dummy implementation of _thread._set_sentinel().)rrrrrÚ _set_sentinelTsrc@s^eZdZdZdd„Zdddd„ZeZdd „Zd d „Zd d „Z dS)ra�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. cCs d|_dS)NF)Ú locked_status)ÚselfrrrÚ__init__cszLockType.__init__NrcCse|dks|rd|_dS|js5d|_dS|dkr]ddl}|j|ƒndSdS)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ÚtimeZsleep)rZwaitflagZtimeoutr!rrrÚacquirefs      zLockType.acquirecCs|jƒdS)N)Úrelease)rÚtypÚvalÚtbrrrÚ__exit__€szLockType.__exit__cCs|jst‚nd|_dS)zRelease the dummy lock.FT)rr)rrrrr#ƒs   zLockType.releasecCs|jS)N)r)rrrrÚlockedŒszLockType.lockedr) Ú__name__Ú __module__Ú __qualname__Ú__doc__r r"Ú __enter__r'r#r(rrrrrXs    FTcCstrt‚ndadS)z^Set _interrupt flag to True to have start_new_thread raise KeyboardInterrupt upon exiting.TN)rrrrrrrr”s l)r,Ú__all__Ú TIMEOUT_MAXÚ RuntimeErrorrrrrrrrÚobjectrrrrrrrrÚ s    8