def synchronized(func):
"""Decorator for storage-access methods, which synchronizes on a threading
lock. The parent object must have 'is_closed' and '_sync_lock' attributes.
"""
@wraps(func)
def synchronized_wrapper(self, *args, **kwargs):
with self._sync_lock:
return func(self, *args, **kwargs)
return synchronized_wrapper
the code is in whoosh/src/util.py,I can't understand the synchronized_wrapper's effect and the parameters in synchronized_wrapper(self, *args, **kwargs) from where. Can anyone give me some pointers?