From dc48f1c7417f0f49ad1bd32330845ce17a29eece Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 3 Apr 2008 22:50:22 +0000 Subject: svn merge -r83872:83893 linden/branches/Branch_1-20-0-Server to linden/release HAVOK4 IN TEH HOUSE!!11!!ONE!! If it is broken blame Joel for not fixing the loginassetdatabaseinventorygroupIM server instead of working on this. QAR-448 --- indra/llmath/llvolumemgr.h | 47 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'indra/llmath/llvolumemgr.h') diff --git a/indra/llmath/llvolumemgr.h b/indra/llmath/llvolumemgr.h index f3d4b5ee6b..c28ffce631 100644 --- a/indra/llmath/llvolumemgr.h +++ b/indra/llmath/llvolumemgr.h @@ -43,9 +43,6 @@ class LLVolumeLODGroup; class LLVolumeLODGroup : public LLThreadSafeRefCount { -protected: - ~LLVolumeLODGroup(); - public: enum { @@ -60,11 +57,19 @@ public: static F32 getVolumeScaleFromDetail(const S32 detail); LLVolume *getLOD(const S32 detail); - const LLVolumeParams &getParams() const { return mParams; }; + const LLVolumeParams& getParams() const { return mParams; }; F32 dump(); friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup); +#ifdef DEBUG_VOLUME + S32 getTotalVolumeRefCount() const; +#endif + +protected: + virtual ~LLVolumeLODGroup(); + void destroy(); + protected: LLVolumeParams mParams; @@ -77,30 +82,50 @@ protected: class LLVolumeMgr { -public: - static void initClass(); - static BOOL cleanupClass(); +//public: +// static void initClass(); +// static BOOL cleanupClass(); public: LLVolumeMgr(); - ~LLVolumeMgr(); + virtual ~LLVolumeMgr(); BOOL cleanup(); // Cleanup all volumes being managed, returns TRUE if no dangling references + + virtual LLVolumeLODGroup* getGroup( const LLVolumeParams& volume_params ) const; + + // whatever calls getVolume() never owns the LLVolume* and + // cannot keep references for long since it may be deleted + // later. For best results hold it in an LLPointer. LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail); + void cleanupVolume(LLVolume *volumep); void dump(); + + // manually call this for mutex magic + void useMutex(); + +#ifdef DEBUG_VOLUME + S32 getTotalRefCount() const; + S32 getGroupCount() const; +#endif friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr); +protected: + virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params); + protected: typedef std::map volume_lod_group_map_t; typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter; volume_lod_group_map_t mVolumeLODGroups; LLMutex* mDataMutex; - -// S32 mNumVolumes; + + // We need to be able to disable threadsafe checks to prevent + // some unit_tests from blocking on failure + bool mThreadSafe; }; -extern LLVolumeMgr* gVolumeMgr; +//extern LLVolumeMgr* gVolumeMgr; #endif // LL_LLVOLUMEMGR_H -- cgit v1.2.3