From 26526038cac9b7cb6ccc83a18559f3f5ed305750 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Mar 2008 18:03:19 +0000 Subject: [PATCH] Added mutex to prevent multiple cull threads changing the MultiTextureControl at one time. --- examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp index e9135ff4a..05ade529d 100644 --- a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp +++ b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp @@ -104,6 +104,8 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback return; } + OpenThreads::ScopedLock lock(_mutex); + float deltaTime = 0.01f; if (_previousFrame!=-1) { @@ -172,6 +174,8 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback float _animationTime; osg::observer_ptr _mtc; Elevations _elevations; + + OpenThreads::Mutex _mutex; };