def protected(func):
    
    @wraps(func)
    def wrapper(self, *args, **kwargs):
        if self.is_closed:
            raise Exception("This object has been closed")
        if self._sync_lock.acquire(False):
            try:
                return func(self, *args, **kwargs)
            finally:
                self._sync_lock.release()
        else:
            raise Exception("Could not acquire sync lock")
    
    return wrapper
Decorator for storage-access methods. This decorator
dataset/ETHPy150Open tallstreet/Whoosh-AppEngine/src/whoosh/util.py/protected