Updated OSG to use OpenThreads. Moved any references to OpenThread to

OpenThreads and removed any dependency on Producer threads, Mutexes, etc.
This commit is contained in:
Don BURNS
2003-07-19 00:18:07 +00:00
parent 23fc1900ce
commit 56a13abc05
8 changed files with 29 additions and 33 deletions

View File

@@ -21,7 +21,7 @@ shift; shift; shift; shift; shift; shift; shift; shift;
OTHER_LIBS=$1
TIFF_LIB=$2
[ "`uname`" = "Darwin" ] && MAKE=make || MAKE=gmake
[ "`uname`" = "Darwin" ] && MAKE=gnumake || MAKE=gmake
copy_example_source()

View File

@@ -154,17 +154,18 @@ __instclean :
empty=`ls $(INSTDEST)`;\
if [ -z "$$empty" ];\
then\
repeat=1;\
while [ $$repeat = 1 ] ; \
do \
printf "$(INSTDEST) is empty. Remove? (y/n) [y]: ";\
read resp;\
case $$resp in \
""|Yes|YES|yes|Y|y) rm -rf $(INSTDEST); repeat=0;; \
n|N|no|NO) repeat=0;; \
*) repeat=1;; \
esac\
done\
rm -rf $(INSTDEST)
# repeat=1;\
# while [ $$repeat = 1 ] ; \
# do \
# printf "$(INSTDEST) is empty. Remove? (y/n) [y]: ";\
# read resp;\
# case $$resp in \
# ""|Yes|YES|yes|Y|y) rm -rf $(INSTDEST); repeat=0;; \
# n|N|no|NO) repeat=0;; \
# *) repeat=1;; \
# esac\
# done\
fi\
fi

View File

@@ -293,7 +293,7 @@ ifeq ($(OS),Linux)
PF_XTRA_LIBS = -L/usr/lib/libpfdb -Xlinker -rpath /usr/lib/libpfdb \
-lpfdu -lpfutil -lpf
SOCKET_LIBS =
OTHER_LIBS = -lpthread
OTHER_LIBS = -lOpenThreads
PNG_LIBS = -lpng
JPEG_LIBS = -ljpeg
TIFF_LIB = -ltiff
@@ -469,7 +469,7 @@ else
ARCHARGS =
ARCHINST =
endif
LINKARGS = -lpthread
LINKARGS = -lOpenThreads
LIB_EXT = sl
PLUGIN_EXT = sl
DYNAMICLIBRARYLIB = -ldld

View File

@@ -19,8 +19,8 @@
#include <osg/PagedLOD>
#include <osg/Drawable>
#include <Producer/Thread>
#include <Producer/Mutex>
#include <OpenThreads/Thread>
#include <OpenThreads/Mutex>
#include <osgProducer/Export>
@@ -31,7 +31,7 @@ namespace osgProducer {
/** Database paging class which manages the loading of files in a background thread,
* and syncronizing of loaded models with the main scene graph.*/
class OSGPRODUCER_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler, public Producer::Thread
class OSGPRODUCER_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler, public OpenThreads::Thread
{
public :
@@ -118,17 +118,17 @@ class OSGPRODUCER_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseReques
typedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList;
DatabaseRequestList _fileRequestList;
Producer::Mutex _fileRequestListMutex;
OpenThreads::Mutex _fileRequestListMutex;
DatabaseRequestList _dataToCompileList;
Producer::Mutex _dataToCompileListMutex;
OpenThreads::Mutex _dataToCompileListMutex;
bool _deleteRemovedSubgraphsInDatabaseThread;
osg::NodeList _childrenToDeleteList;
Producer::Mutex _childrenToDeleteListMutex;
OpenThreads::Mutex _childrenToDeleteListMutex;
DatabaseRequestList _dataToMergeList;
Producer::Mutex _dataToMergeListMutex;
OpenThreads::Mutex _dataToMergeListMutex;
PagedLODList _pagedLODList;

View File

@@ -14,10 +14,10 @@
#ifndef OSGPRODUCER_EVENTCALLBACK
#define OSGPRODUCER_EVENTCALLBACK 1
#include <OpenThreads/Mutex>
#include <Producer/RenderSurface> // For definition of KeySymbol
#include <Producer/KeyboardMouse>
#include <Producer/Mutex>
#include <osgProducer/EventAdapter>
@@ -90,7 +90,7 @@ class OSGPRODUCER_EXPORT KeyboardMouseCallback : public Producer::KeyboardMouseC
osg::Timer_t _startTick;
osg::Timer _timer;
Producer::Mutex _eventQueueMutex;
OpenThreads::Mutex _eventQueueMutex;
EventQueue _eventQueue;
};

View File

@@ -91,7 +91,8 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
_fileRequestListMutex.unlock();
}
if (!threadIsRunning())
//if (!threadIsRunning())
if (!isRunning())
{
std::cout<<"DatabasePager::startThread()"<<std::endl;
startThread();

View File

@@ -20,11 +20,4 @@ LIB = $(LIB_PREFIX)$(TARGET_BASENAME).$(LIB_EXT)
INC += $(PRODUCER_INCLUDE_DIR) -I/usr/X11R6/include
LDFLAGS += $(PRODUCER_LIB_DIR)
ifeq ($(USE_OPEN_THREAD),1)
DEF += -D_USE_OPEN_THREAD
INC += $(INC_OPEN_THREAD)
LDFLAGS += $(LIB_OPEN_THREAD)
LIBS += -lOpenThread
endif
include $(TOPDIR)/Make/makerules

View File

@@ -11,8 +11,9 @@
* OpenSceneGraph Public License for more details.
*/
#include <OpenThreads/Mutex>
#include <osgProducer/OsgSceneHandler>
#include <Producer/Mutex>
using namespace osgUtil;
using namespace osgProducer;
@@ -24,7 +25,7 @@ OsgSceneHandler::OsgSceneHandler( osg::DisplaySettings *ds) :
void OsgSceneHandler::init()
{
static Producer::Mutex mutex;
static OpenThreads::Mutex mutex;
osg::notify(osg::INFO)<<"entering "<<this<<" init."<<std::endl;
mutex.lock();
osg::notify(osg::INFO)<<" running "<<this<<" init."<<std::endl;