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
コードは whoosh/src/util.py にありますが、synchronized_wrapper の効果と、synchronized_wrapper(self, *args, **kwargs) のパラメーターがどこから来たのか理解できません。誰かが私にいくつかの指針を与えることができますか?