lock/unlock when getting size