A lock should be added when calling generatePointCloud, or the addresses of the vectors may shift when other threads execute the push_back operation.
This is especially likely to happen in a device where the memory is limited and the memory block allocated initially is not large enough. If it happens, a segmentation fault will result.
Wrong:
A lock should be added when calling generatePointCloud, or the addresses of the vectors may shift when other threads execute the push_back operation. This is especially likely to happen in a device where the memory is limited and the memory block allocated initially is not large enough. If it happens, a segmentation fault will result. Wrong:
A possible correction: