QRegularExpression: fix optimizePattern, document the issue
authorGiuseppe D'Angelo <dangelog@gmail.com>
Thu, 16 Feb 2012 22:49:27 +0000 (23:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 7 Mar 2012 01:02:50 +0000 (02:02 +0100)
commita47d974e19512ae5a445f64fbd2b1703201f781d
treecf1d357ac48c3792d21deef96f7bf7262efa4fb2
parent6e58dd34ac96e2cf0807a227caaef74d15e272e7
QRegularExpression: fix optimizePattern, document the issue

The studyData pointer is atomically set by the pointer assignment,
but another processor running a different thread might see the
new studyData value but not the memory it points to.

Therefore, the current studyData is returned from optimizePattern
and used by that thread.

Docs were added to optimizePattern to explain what's going on.

Change-Id: I4502c336077bb98a1751011aa93ffd4f585ed101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qregularexpression.cpp