
    &`i                     >    d dl mZ d dlmZ ededefd            ZdS )    )Callable)OldAPIStackfuncreturnc                       fd}|S )a  Use as decorator (@withlock) around object methods that need locking.

    Note: The object must have a self._lock = threading.Lock() property.
    Locking thus works on the object level (no two locked methods of the same
    object can be called asynchronously).

    Args:
        func: The function to decorate/wrap.

    Returns:
        The wrapped (object-level locked) function.
    c                     	 | j         5   | g|R i |cd d d            S # 1 swxY w Y   d S # t          $ r8}d|j        d         v r"t          d                    |                     |d }~ww xY w)Nzhas no attribute '_lock'r   zhObject {} must have a `self._lock` property (assigned to a threading.RLock() object in its constructor)!)_lockAttributeErrorargsformat)selfaker   s       m/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/rllib/utils/threading.pywrapperzwith_lock.<locals>.wrapper   s    
	 + +tD*1*****+ + + + + + + + + + + + + + + + + + 	 	 	)QVAY66$$$*F4LL  
 G	s,   0 #0 '0 '0 
A23A--A2 )r   r   s   ` r   	with_lockr      s#         N    N)typingr   ray.rllib.utils.annotationsr   r   r   r   r   <module>r      sa          3 3 3 3 3 3 H       r   