title: Is cv::Mat thread-safe (atomic assignment + refcounting)?
body: <p>I'm attempting to share an image, that is only being used read-only, across threads. Typically I do this sort of thing with boost::shared_ptrs but since cv::Mat is already a reference counting container underneath, I've been attempting to use it in the same manner assuming that it is thread safe based on references to thread safety in reference counting here:</p>
  
  <ul>
  <li><strike><a href="http://opencv.willowgarage.com/documentation/cpp/basic_structures.html" rel="nofollow noreferrer">http://opencv.willowgarage.com/documentation/cpp/basic_structures.html</a></strike></li>
  <li><a href="https://docs.opencv.org/2.4/modules/core/doc/basic_structures.html" rel="nofollow noreferrer">https://docs.opencv.org/2.4/modules/core/doc/basic_structures.html</a></li>
  </ul>
  
  <p>However I've been having having issues that might possibly indicate that they are infact not thread safe; that assignment is non-atomic. Occasionally I'll get a seg-fault inside a reference count increment that implies that the original object has already been destroyed.</p>
  
  <p>So the specific question is:</p>
  
  <ul>
  <li>Is cv::Mat assignment atomic?</li>
  </ul>