summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-11-23 17:49:01 -0800
committerSteve Bennetts <steve@lindenlab.com>2009-11-23 17:49:01 -0800
commitaec42e3fa2d8a1a4f0c07821821c114d72c339a7 (patch)
tree6317ab4db7bebd3974c77c0226a10cc4cb33f4be /indra
parent7bfa11ed694f9fffa9d8983f3d60f740d630cfc2 (diff)
parentdb79b2d0920bff9bf4f36e8249c0a243581d4c44 (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llthread.cpp18
-rw-r--r--indra/llcommon/llthread.h5
-rw-r--r--indra/llmessage/llcachename.cpp36
-rw-r--r--indra/llmessage/llcachename.h4
-rw-r--r--indra/newview/llappviewer.cpp48
-rw-r--r--indra/newview/lltexturefetch.cpp8
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml4
7 files changed, 101 insertions, 22 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 920d8c0977..37370e44e7 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -291,8 +291,8 @@ LLMutex::LLMutex(apr_pool_t *poolp) :
LLMutex::~LLMutex()
{
-#if _DEBUG
- llassert(!isLocked()); // better not be locked!
+#if MUTEX_DEBUG
+ llassert_always(!isLocked()); // better not be locked!
#endif
apr_thread_mutex_destroy(mAPRMutexp);
mAPRMutexp = NULL;
@@ -306,10 +306,24 @@ LLMutex::~LLMutex()
void LLMutex::lock()
{
apr_thread_mutex_lock(mAPRMutexp);
+#if MUTEX_DEBUG
+ // Have to have the lock before we can access the debug info
+ U32 id = LLThread::currentID();
+ if (mIsLocked[id] != FALSE)
+ llerrs << "Already locked in Thread: " << id << llendl;
+ mIsLocked[id] = TRUE;
+#endif
}
void LLMutex::unlock()
{
+#if MUTEX_DEBUG
+ // Access the debug info while we have the lock
+ U32 id = LLThread::currentID();
+ if (mIsLocked[id] != TRUE)
+ llerrs << "Not locked in Thread: " << id << llendl;
+ mIsLocked[id] = FALSE;
+#endif
apr_thread_mutex_unlock(mAPRMutexp);
}
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 932d96d940..d8aa90de2e 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -128,6 +128,8 @@ protected:
//============================================================================
+#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
+
class LL_COMMON_API LLMutex
{
public:
@@ -142,6 +144,9 @@ protected:
apr_thread_mutex_t *mAPRMutexp;
apr_pool_t *mAPRPoolp;
BOOL mIsLocalPool;
+#if MUTEX_DEBUG
+ std::map<U32, BOOL> mIsLocked;
+#endif
};
// Actually a condition/mutex pair (since each condition needs to be associated with a mutex).
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index a403c44b71..3078d80552 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -189,6 +189,7 @@ typedef std::set<LLUUID> AskQueue;
typedef std::list<PendingReply*> ReplyQueue;
typedef std::map<LLUUID,U32> PendingQueue;
typedef std::map<LLUUID, LLCacheNameEntry*> Cache;
+typedef std::map<std::string, LLUUID> ReverseCache;
class LLCacheName::Impl
{
@@ -198,7 +199,9 @@ public:
Cache mCache;
// the map of UUIDs to names
-
+ ReverseCache mReverseCache;
+ // map of names to UUIDs
+
AskQueue mAskNameQueue;
AskQueue mAskGroupQueue;
// UUIDs to ask our upstream host about
@@ -371,7 +374,9 @@ void LLCacheName::importFile(LLFILE* fp)
entry->mFirstName = firstname;
entry->mLastName = lastname;
impl.mCache[id] = entry;
-
+ std::string fullname = entry->mFirstName + " " + entry->mLastName;
+ impl.mReverseCache[fullname] = id;
+
count++;
}
@@ -407,6 +412,8 @@ bool LLCacheName::importFile(std::istream& istr)
entry->mFirstName = agent[FIRST].asString();
entry->mLastName = agent[LAST].asString();
impl.mCache[id] = entry;
+ std::string fullname = entry->mFirstName + " " + entry->mLastName;
+ impl.mReverseCache[fullname] = id;
++count;
}
@@ -428,6 +435,7 @@ bool LLCacheName::importFile(std::istream& istr)
entry->mCreateTime = ctime;
entry->mGroupName = group[NAME].asString();
impl.mCache[id] = entry;
+ impl.mReverseCache[entry->mGroupName] = id;
++count;
}
llinfos << "LLCacheName loaded " << count << " group names" << llendl;
@@ -548,6 +556,27 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group)
return FALSE;
}
}
+
+BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id)
+{
+ std::string fullname = first + " " + last;
+ return getUUID(fullname, id);
+}
+
+BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id)
+{
+ ReverseCache::iterator iter = impl.mReverseCache.find(fullname);
+ if (iter != impl.mReverseCache.end())
+ {
+ id = iter->second;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
// This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer.
// The reason it is a slot is so that the legacy get() function below can bind an old callback
// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior
@@ -897,10 +926,13 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup)
if (!isGroup)
{
mSignal(id, entry->mFirstName, entry->mLastName, FALSE);
+ std::string fullname = entry->mFirstName + " " + entry->mLastName;
+ mReverseCache[fullname] = id;
}
else
{
mSignal(id, entry->mGroupName, "", TRUE);
+ mReverseCache[entry->mGroupName] = id;
}
}
}
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index 8641437d86..29601ddc63 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -86,6 +86,10 @@ public:
BOOL getName(const LLUUID& id, std::string& first, std::string& last);
BOOL getFullName(const LLUUID& id, std::string& fullname);
+ // Reverse lookup of UUID from name
+ BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id);
+ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id);
+
// If available, this method copies the group name into the string
// provided. The caller must allocate at least
// DB_GROUP_NAME_BUF_SIZE characters. If not available, this
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4f2d3e9645..fa0ea557ba 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1360,19 +1360,25 @@ bool LLAppViewer::cleanup()
llinfos << "Waiting for pending IO to finish: " << pending << llendflush;
ms_sleep(100);
}
- llinfos << "Shutting down." << llendflush;
+ llinfos << "Shutting down Views" << llendflush;
// Destroy the UI
if( gViewerWindow)
gViewerWindow->shutdownViews();
+
+ llinfos << "Cleaning up Inevntory" << llendflush;
// Cleanup Inventory after the UI since it will delete any remaining observers
// (Deleted observers should have already removed themselves)
gInventory.cleanupInventory();
+
+ llinfos << "Cleaning up Selections" << llendflush;
// Clean up selection managers after UI is destroyed, as UI may be observing them.
// Clean up before GL is shut down because we might be holding on to objects with texture references
LLSelectMgr::cleanupGlobals();
+
+ llinfos << "Shutting down OpenGL" << llendflush;
// Shut down OpenGL
if( gViewerWindow)
@@ -1386,11 +1392,18 @@ bool LLAppViewer::cleanup()
gViewerWindow = NULL;
llinfos << "ViewerWindow deleted" << llendflush;
}
+
+ llinfos << "Cleaning up Keyboard & Joystick" << llendflush;
// viewer UI relies on keyboard so keep it aound until viewer UI isa gone
delete gKeyboard;
gKeyboard = NULL;
+ // Turn off Space Navigator and similar devices
+ LLViewerJoystick::getInstance()->terminate();
+
+ llinfos << "Cleaning up Objects" << llendflush;
+
LLViewerObject::cleanupVOClasses();
LLWaterParamManager::cleanupClass();
@@ -1413,6 +1426,8 @@ bool LLAppViewer::cleanup()
}
LLPrimitive::cleanupVolumeManager();
+ llinfos << "Additional Cleanup..." << llendflush;
+
LLViewerParcelMgr::cleanupGlobals();
// *Note: this is where gViewerStats used to be deleted.
@@ -1432,9 +1447,11 @@ bool LLAppViewer::cleanup()
// Also after shutting down the messaging system since it has VFS dependencies
//
+ llinfos << "Cleaning up VFS" << llendflush;
LLVFile::cleanupClass();
- llinfos << "VFS cleaned up" << llendflush;
+ llinfos << "Saving Data" << llendflush;
+
// Quitting with "Remember Password" turned off should always stomp your
// saved password, whether or not you successfully logged in. JC
if (!gSavedSettings.getBOOL("RememberPassword"))
@@ -1476,13 +1493,16 @@ bool LLAppViewer::cleanup()
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask);
}
- // Turn off Space Navigator and similar devices
- LLViewerJoystick::getInstance()->terminate();
-
removeMarkerFile(); // Any crashes from here on we'll just have to ignore
writeDebugInfo();
+ LLLocationHistory::getInstance()->save();
+
+ LLAvatarIconIDCache::getInstance()->save();
+
+ llinfos << "Shutting down Threads" << llendflush;
+
// Let threads finish
LLTimer idleTimer;
idleTimer.reset();
@@ -1515,14 +1535,9 @@ bool LLAppViewer::cleanup()
sTextureFetch = NULL;
delete sImageDecodeThread;
sImageDecodeThread = NULL;
-
- LLLocationHistory::getInstance()->save();
-
- LLAvatarIconIDCache::getInstance()->save();
-
delete mFastTimerLogThread;
mFastTimerLogThread = NULL;
-
+
if (LLFastTimerView::sAnalyzePerformance)
{
llinfos << "Analyzing performance" << llendl;
@@ -1544,6 +1559,8 @@ bool LLAppViewer::cleanup()
}
LLMetricPerformanceTester::cleanClass() ;
+ llinfos << "Cleaning up Media and Textures" << llendflush;
+
//Note:
//LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown()
//because some new image might be generated during cleaning up media. --bao
@@ -1557,13 +1574,13 @@ bool LLAppViewer::cleanup()
LLVFSThread::cleanupClass();
LLLFSThread::cleanupClass();
- llinfos << "VFS Thread finished" << llendflush;
-
#ifndef LL_RELEASE_FOR_DOWNLOAD
llinfos << "Auditing VFS" << llendl;
gVFS->audit();
#endif
+ llinfos << "Misc Cleanup" << llendflush;
+
// For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up.
// (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve
delete gStaticVFS;
@@ -1577,12 +1594,11 @@ bool LLAppViewer::cleanup()
LLWatchdog::getInstance()->cleanup();
+ llinfos << "Shutting down message system" << llendflush;
end_messaging_system();
- llinfos << "Message system deleted." << llendflush;
// *NOTE:Mani - The following call is not thread safe.
LLCurl::cleanupClass();
- llinfos << "LLCurl cleaned up." << llendflush;
// If we're exiting to launch an URL, do that here so the screen
// is at the right resolution before we launch IE.
@@ -1603,7 +1619,7 @@ bool LLAppViewer::cleanup()
ll_close_fail_log();
- llinfos << "Goodbye" << llendflush;
+ llinfos << "Goodbye!" << llendflush;
// return 0;
return true;
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 6f3dabe5a7..9bb2a4ad0a 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -931,6 +931,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mState == DECODE_IMAGE)
{
+ if (mDesiredDiscard < 0)
+ {
+ // We aborted, don't decode
+ mState = DONE;
+ setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
+ return true;
+ }
+
if (mFormattedImage->getDataSize() <= 0)
{
llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl;
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 01713cc003..95d40d297b 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -8,9 +8,9 @@
left="0"
name="panel_im"
top="0"
- can_close="true"
+ can_close="false"
can_dock="true"
- can_minimize="false"
+ can_minimize="true"
visible="true"
width="300"
can_resize="true"