onetimejwt/__init__.py
def mutex(func):
    """use a thread lock on current method, if self.lock is defined"""
    def wrapper(*args, **kwargs):
        """Decorator Wrapper"""
        lock = args[0].lock
        lock.acquire(True)
        try:
            return func(*args, **kwargs)
        except:
            raise
        finally:
            lock.release()

    return wrapper
def mutex(func):
    def wrapper(*args, **kwargs):
        """Decorator Wrapper"""
        lock = args[0].lock
        lock.acquire(True)
        try:
            return func(*args, **kwargs)
        except:
            raise
        finally:
            lock.release()

    return wrapper
def mutex ( func ) : def wrapper ( * args , * * kwargs ) : """Decorator Wrapper""" lock = args [ 0 ] . lock lock . acquire ( True ) try : return func ( * args , * * kwargs ) except : raise finally : lock . release ( ) return wrapper
use a thread lock on current method, if self.lock is defined
use a thread lock on current method if self . lock is defined