distributed lock pattern