add lock/unlock in distributedArray