Use functools to define wrapper in  _synchronized