restored mutex to original scope

release/4.3a0
Frank Dellaert 2015-07-11 21:14:45 -07:00
parent c8cf14d4b9
commit 48169e7776
1 changed files with 6 additions and 7 deletions

View File

@ -74,6 +74,10 @@ static tbb::mutex unit3BasisMutex;
/* ************************************************************************* */
const Matrix32& Unit3::basis() const {
#ifdef GTSAM_USE_TBB
tbb::mutex::scoped_lock lock(unit3BasisMutex);
#endif
// Return cached version if exists
if (B_) return *B_;
@ -94,13 +98,8 @@ const Matrix32& Unit3::basis() const {
Vector3 b2 = p_.cross(b1).normalized();
// Create the basis matrix
{
#ifdef GTSAM_USE_TBB
tbb::mutex::scoped_lock lock(unit3BasisMutex);
#endif
B_.reset(Matrix32());
(*B_) << b1, b2;
}
B_.reset(Matrix32());
(*B_) << b1, b2;
return *B_;
}