Fix TSAN warnings for ripples emitter

While main thread creates particles rendering thread draws them so
sychronization is required.
pull/578/head^2
elsid 5 years ago
parent b372ac9119
commit a4e3f32ec8
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -200,6 +200,7 @@ void RippleSimulation::emitRipple(const osg::Vec3f &pos)
{
if (std::abs(pos.z() - mParticleNode->getPosition().z()) < 20)
{
osgParticle::ParticleSystem::ScopedWriteLock lock(*mParticleSystem->getReadWriteMutex());
osgParticle::Particle* p = mParticleSystem->createParticle(nullptr);
p->setPosition(osg::Vec3f(pos.x(), pos.y(), 0.f));
p->setAngle(osg::Vec3f(0,0, Misc::Rng::rollProbability() * osg::PI * 2 - osg::PI));

Loading…
Cancel
Save