From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/llcommon/llrefcount.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/llcommon/llrefcount.h') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index a18f6706a9..19f008b15c 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -2,31 +2,25 @@ * @file llrefcount.h * @brief Base class for reference counted objects for use with LLPointer * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #ifndef LLREFCOUNT_H -- cgit v1.2.3 From f1b7fce1db6cd7a8f312216baaa8fada931b2579 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 4 Jan 2011 16:28:40 -0700 Subject: a debug tool to detect LLPointer issues for SH-694: check if there are any other LLPointer issues in the mesh model uploading flow and fix them if exist. This debug tool is off by default. To turn it on, set LL_REF_COUNT_DEBUG to be 1 in the header file "llcommon/llrefcount.h". --- indra/llcommon/llrefcount.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llrefcount.h') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 19f008b15c..693c1c4b83 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -28,6 +28,11 @@ #include +#define LL_REF_COUNT_DEBUG 0 +#if LL_REF_COUNT_DEBUG +class LLMutex ; +#endif + //---------------------------------------------------------------------------- // RefCount objects should generally only be accessed by way of LLPointer<>'s // see llthread.h for LLThreadSafeRefCount @@ -43,12 +48,16 @@ protected: public: LLRefCount(); - void ref() const +#if LL_REF_COUNT_DEBUG + void ref() const ; + S32 unref() const ; +#else + inline void LLRefCount::ref() const { mRef++; } - S32 unref() const + inline S32 LLRefCount::unref() const { llassert(mRef >= 1); if (0 == --mRef) @@ -58,6 +67,7 @@ public: } return mRef; } +#endif //NOTE: when passing around a const LLRefCount object, this can return different results // at different types, since mRef is mutable @@ -68,6 +78,12 @@ public: private: mutable S32 mRef; + +#if LL_REF_COUNT_DEBUG + LLMutex* mMutexp ; + mutable U32 mLockedThreadID ; + mutable BOOL mCrashAtUnlock ; +#endif }; #endif -- cgit v1.2.3 From c876e78c10d749f3d4ec9ba00e6ef0ca1cfd4851 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 4 Jan 2011 17:51:58 -0700 Subject: trival: fix compiling errors for Linux. --- indra/llcommon/llrefcount.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llrefcount.h') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 693c1c4b83..868789de4d 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -52,12 +52,12 @@ public: void ref() const ; S32 unref() const ; #else - inline void LLRefCount::ref() const + void LLRefCount::ref() const { mRef++; } - inline S32 LLRefCount::unref() const + S32 LLRefCount::unref() const { llassert(mRef >= 1); if (0 == --mRef) -- cgit v1.2.3 From d8cf705d0189ec34b1202ee50ea3e5991cf4c90f Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 6 Jan 2011 13:07:18 -0500 Subject: BUILDFIX: fixing linux build breakage cleaning up a bit of syntax that gcc is complaining about. reviewed by bao --- indra/llcommon/llrefcount.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llrefcount.h') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 868789de4d..8eb5d53f3f 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -52,12 +52,12 @@ public: void ref() const ; S32 unref() const ; #else - void LLRefCount::ref() const + inline void ref() const { mRef++; } - S32 LLRefCount::unref() const + inline S32 unref() const { llassert(mRef >= 1); if (0 == --mRef) -- cgit v1.2.3