diff options
author | Kelly Washington <kelly@lindenlab.com> | 2008-04-03 22:50:22 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2008-04-03 22:50:22 +0000 |
commit | dc48f1c7417f0f49ad1bd32330845ce17a29eece (patch) | |
tree | 8772aff5f32c1702228b7ca7e324fbd077269854 /indra/llmath/llvolumemgr.h | |
parent | b5936a4b1d8780b5b8cd425998eacd2c64ffa693 (diff) |
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
Diffstat (limited to 'indra/llmath/llvolumemgr.h')
-rw-r--r-- | indra/llmath/llvolumemgr.h | 47 |
1 files changed, 36 insertions, 11 deletions
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>. 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<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> 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 |