Use the intrinsic lock of the object "entities"