summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorPalmer <palmer@lindenlab.com>2010-03-05 13:11:26 -0800
committerPalmer <palmer@lindenlab.com>2010-03-05 13:11:26 -0800
commitb70951ca1e319e4d4a427a559072ee722588e1ed (patch)
tree59f8edc208a98a3f74586a0458417a1ce14c00ff /indra/llcommon
parentdd663449b6f8b802892e11fab7cc2cbce36f734f (diff)
parent32aa06139e6fb5f2e84d3e657dfbe8961170a804 (diff)
merge
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llsys.cpp27
-rw-r--r--indra/llcommon/llsys.h15
-rw-r--r--indra/llcommon/llworkerthread.cpp36
-rw-r--r--indra/llcommon/llworkerthread.h3
4 files changed, 80 insertions, 1 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 0272c55db2..0ed700b9da 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -775,6 +775,33 @@ void LLMemoryInfo::stream(std::ostream& s) const
#endif
}
+S32 LLDisplayInfo::getDisplayWidth() const
+{
+#if LL_WINDOWS
+ return ::GetSystemMetrics(SM_CXVIRTUALSCREEN);
+#elif LL_DARWIN
+ return 1024; //*FIXME
+#elif LL_SOLARIS
+ return 1024; //*FIXME
+#else
+ return 1024; //*FIXME
+#endif
+}
+
+S32 LLDisplayInfo::getDisplayHeight() const
+{
+#if LL_WINDOWS
+ return ::GetSystemMetrics(SM_CYVIRTUALSCREEN);
+#elif LL_DARWIN
+ return 768; //*FIXME
+#elif LL_SOLARIS
+ return 768; //*FIXME
+#else
+ return 768; //*FIXME
+#endif
+}
+
+
std::ostream& operator<<(std::ostream& s, const LLOSInfo& info)
{
info.stream(s);
diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h
index c2c45bec9a..aa3fdd485b 100644
--- a/indra/llcommon/llsys.h
+++ b/indra/llcommon/llsys.h
@@ -122,6 +122,21 @@ public:
U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes
};
+//=============================================================================
+//
+// CLASS LLDisplayInfo
+class LL_COMMON_API LLDisplayInfo
+
+/*! @brief Class to query the information about some display settings
+*/
+{
+public:
+ LLDisplayInfo(){}; ///< Default constructor
+
+ S32 getDisplayWidth() const; ///< display width
+ S32 getDisplayHeight() const; ///< display height
+
+};
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLOSInfo& info);
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCPUInfo& info);
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp
index 1b0e03cb2a..411977474b 100644
--- a/indra/llcommon/llworkerthread.cpp
+++ b/indra/llcommon/llworkerthread.cpp
@@ -65,6 +65,27 @@ LLWorkerThread::~LLWorkerThread()
// ~LLQueuedThread() will be called here
}
+//called only in destructor.
+void LLWorkerThread::clearDeleteList()
+{
+ // Delete any workers in the delete queue (should be safe - had better be!)
+ if (!mDeleteList.empty())
+ {
+ llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
+ << " entries in delete list." << llendl;
+
+ mDeleteMutex->lock();
+ for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter)
+ {
+ (*iter)->mRequestHandle = LLWorkerThread::nullHandle();
+ (*iter)->clearFlags(LLWorkerClass::WCF_HAVE_WORK);
+ delete *iter ;
+ }
+ mDeleteList.clear() ;
+ mDeleteMutex->unlock() ;
+ }
+}
+
// virtual
S32 LLWorkerThread::update(U32 max_time_ms)
{
@@ -320,7 +341,20 @@ bool LLWorkerClass::checkWork(bool aborting)
if (mRequestHandle != LLWorkerThread::nullHandle())
{
LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle);
- llassert_always(workreq);
+ if(!workreq)
+ {
+ if(mWorkerThread->isQuitting() || mWorkerThread->isStopped()) //the mWorkerThread is not running
+ {
+ mRequestHandle = LLWorkerThread::nullHandle();
+ clearFlags(WCF_HAVE_WORK);
+ return true ;
+ }
+ else
+ {
+ llassert_always(workreq);
+ }
+ }
+
LLQueuedThread::status_t status = workreq->getStatus();
if (status == LLWorkerThread::STATUS_ABORTED)
{
diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h
index a1e85d2ecc..1756ebab6b 100644
--- a/indra/llcommon/llworkerthread.h
+++ b/indra/llcommon/llworkerthread.h
@@ -80,6 +80,9 @@ public:
S32 mParam;
};
+protected:
+ void clearDeleteList() ;
+
private:
typedef std::list<LLWorkerClass*> delete_list_t;
delete_list_t mDeleteList;