Use lock decorator.