a )gn@s2ddlmZmZmZeZddlmZdddZdS))absolute_importdivisionprint_functionwrapsmissing_lock_attrNcsfdd}|S)aoThis decorator is a generic implementation that allows you to either use a pre-defined instance attribute as the location of the lock, or to explicitly pass a lock object. This code was implemented with ``threading.Lock`` in mind, but may work with other locks, assuming that they function as context managers. When using ``attr``, the assumption is the first argument to the wrapped method, is ``self`` or ``cls``. Examples: @lock_decorator(attr='_callback_lock') def send_callback(...): @lock_decorator(lock=threading.Lock()) def some_method(...): cstfdd}|S)NcsRdurt|d}n}||i|WdS1sD0YdS)Nr)getattr)argskwargs_lock)attrfunclock6/usr/lib/python3.9/site-packages/ansible/utils/lock.pyinner s z,lock_decorator..outer..innerr)r rr r)r routers zlock_decorator..outerr)r rrrrrlock_decorator s r)rN) Z __future__rrrtypeZ __metaclass__ functoolsrrrrrrs