N D d dl Z G d de Z G d d ZdS ) Nc e Zd ZdZdS )
DeadlockErrorz6Error raised if DeadlockDetectingLock detects deadlockN)__name__
__module____qualname____doc__ f/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/internals/deadlock_detecting_lock.pyr r s @@@@r
r c * e Zd ZdZd Zd Zd Zd ZdS )DeadlockDetectingLockzp
Lock that detects deadlock when it is about to be
acquired by the same task that already holds it.
c D t j | _ d | _ d S N)asyncioLock_lock_ownerselfs r __init__zDeadlockDetectingLock.__init__ s \^^
r
c 4 | j S r )r lockedr s r r zDeadlockDetectingLock.locked s z """r
c K t j }| j |k rt | j d {V || _ | S r )r current_taskr r r acquire)r curr_tasks r
__aenter__z DeadlockDetectingLock.__aenter__ s] (** ;)##//!j """""""""r
c J K d | _ | j d S r )r r release)r exc_typeexctbs r __aexit__zDeadlockDetectingLock.__aexit__ s'
r
N)r r r r r r r r# r r
r r
r
sZ
# # # r
r
)r Exceptionr r
r r
r