Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer.git into testpit
Conflicts: indra/newview/lldrawpoolavatar.cpp indra/newview/llviewertexturelist.cpp indra/newview/llworldmap.cpp indra/newview/pipeline.cpp
This commit is contained in:
@@ -329,14 +329,14 @@ struct AIReadAccessConst
|
||||
};
|
||||
|
||||
//! Construct a AIReadAccessConst from a constant AIThreadSafe.
|
||||
AIReadAccessConst(AIThreadSafe<T> const& wrapper)
|
||||
AIReadAccessConst(AIThreadSafe<T> const& wrapper, bool high_priority = false)
|
||||
: mWrapper(const_cast<AIThreadSafe<T>&>(wrapper)),
|
||||
mState(readlocked)
|
||||
#if AI_NEED_ACCESS_CC
|
||||
, mIsCopyConstructed(false)
|
||||
#endif
|
||||
{
|
||||
mWrapper.mRWLock.rdlock();
|
||||
mWrapper.mRWLock.rdlock(high_priority);
|
||||
}
|
||||
|
||||
//! Destruct the AI*Access object.
|
||||
@@ -393,7 +393,7 @@ struct AIReadAccess : public AIReadAccessConst<T>
|
||||
using AIReadAccessConst<T>::readlocked;
|
||||
|
||||
//! Construct a AIReadAccess from a non-constant AIThreadSafe.
|
||||
AIReadAccess(AIThreadSafe<T>& wrapper) : AIReadAccessConst<T>(wrapper, readlocked) { this->mWrapper.mRWLock.rdlock(); }
|
||||
AIReadAccess(AIThreadSafe<T>& wrapper, bool high_priority = false) : AIReadAccessConst<T>(wrapper, readlocked) { this->mWrapper.mRWLock.rdlock(high_priority); }
|
||||
|
||||
protected:
|
||||
//! Constructor used by AIWriteAccess.
|
||||
|
||||
@@ -36,26 +36,39 @@
|
||||
#include "llapr.h"
|
||||
#include "llscopedvolatileaprpool.h"
|
||||
|
||||
LLFastTimer::DeclareTimer FT_WAIT_FOR_SCOPEDLOCK("LLScopedLock");
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
// LLScopedLock
|
||||
//
|
||||
LLScopedLock::LLScopedLock(apr_thread_mutex_t* mutex) : mMutex(mutex)
|
||||
{
|
||||
if(mutex)
|
||||
mLocked = !!mutex;
|
||||
if (LL_LIKELY(mutex))
|
||||
{
|
||||
if(ll_apr_warn_status(apr_thread_mutex_lock(mMutex)))
|
||||
apr_status_t status = apr_thread_mutex_trylock(mMutex);
|
||||
while (LL_UNLIKELY(status != APR_SUCCESS))
|
||||
{
|
||||
mLocked = false;
|
||||
if (APR_STATUS_IS_EBUSY(status))
|
||||
{
|
||||
if (AIThreadID::in_main_thread_inline())
|
||||
{
|
||||
LLFastTimer ft1(FT_WAIT_FOR_SCOPEDLOCK);
|
||||
status = apr_thread_mutex_lock(mMutex);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = apr_thread_mutex_lock(mMutex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ll_apr_warn_status(status);
|
||||
mLocked = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mLocked = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @breif filesize helpers.
|
||||
* @brief filesize helpers.
|
||||
*
|
||||
* The file size helpers are not considered particularly efficient,
|
||||
* and should only be used for config files and the like -- not in a
|
||||
|
||||
@@ -179,7 +179,6 @@ LLMemType::DeclareMemType LLMemType::MTYPE_IO_BUFFER("IoBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_HTTP_SERVER("IoHttpServer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_SERVER("IoSDServer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_CLIENT("IoSDClient");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_URL_REQUEST("IOUrlRequest");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DIRECTX_INIT("DirectXInit");
|
||||
|
||||
|
||||
@@ -223,7 +223,6 @@ public:
|
||||
static DeclareMemType MTYPE_IO_HTTP_SERVER;
|
||||
static DeclareMemType MTYPE_IO_SD_SERVER;
|
||||
static DeclareMemType MTYPE_IO_SD_CLIENT;
|
||||
static DeclareMemType MTYPE_IO_URL_REQUEST;
|
||||
|
||||
static DeclareMemType MTYPE_DIRECTX_INIT;
|
||||
|
||||
|
||||
@@ -368,6 +368,7 @@ public:
|
||||
* should work.
|
||||
*/
|
||||
static void _makeASCII(string_type& string);
|
||||
static bool _isASCII(std::basic_string<T> const& string);
|
||||
|
||||
// Conversion to other data types
|
||||
static BOOL convertToBOOL(const string_type& string, BOOL& value);
|
||||
@@ -1473,6 +1474,19 @@ void LLStringUtilBase<T>::_makeASCII(string_type& string)
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool LLStringUtilBase<T>::_isASCII(std::basic_string<T> const& string)
|
||||
{
|
||||
size_type const len = string.length();
|
||||
T bit_collector = 0;
|
||||
for (size_type i = 0; i < len; ++i)
|
||||
{
|
||||
bit_collector |= string[i];
|
||||
}
|
||||
T const ascii_bits = 0x7f;
|
||||
return !(bit_collector & ~ascii_bits);
|
||||
}
|
||||
|
||||
// static
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::copy( T* dst, const T* src, size_type dst_size )
|
||||
|
||||
@@ -113,12 +113,11 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
|
||||
|
||||
// Only now print this info [doing that before setting mStatus
|
||||
// to STOPPED makes it much more likely that another thread runs
|
||||
// after the LLCurl::Multi::run() function exits and we actually
|
||||
// change this variable (which really SHOULD have been inside
|
||||
// the critical area of the mSignal lock)].
|
||||
// after the AICurlPrivate::curlthread::AICurlThread::run() function
|
||||
// exits and we actually change this variable (which really SHOULD
|
||||
// have been inside the critical area of the mSignal lock)].
|
||||
lldebugs << "LLThread::staticRun() Exiting: " << name << llendl;
|
||||
|
||||
--sRunning; // Would be better to do this after joining with the thread, but we don't join :/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -383,9 +382,19 @@ LLCondition::~LLCondition()
|
||||
mAPRCondp = NULL;
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FT_WAIT_FOR_CONDITION("LLCondition::wait()");
|
||||
|
||||
void LLCondition::wait()
|
||||
{
|
||||
apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
|
||||
if (AIThreadID::in_main_thread_inline())
|
||||
{
|
||||
LLFastTimer ft1(FT_WAIT_FOR_CONDITION);
|
||||
apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
|
||||
}
|
||||
else
|
||||
{
|
||||
apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
|
||||
}
|
||||
}
|
||||
|
||||
void LLCondition::signal()
|
||||
@@ -410,6 +419,8 @@ bool LLMutexBase::isSelfLocked() const
|
||||
return mLockingThread.equals_current_thread_inline();
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FT_WAIT_FOR_MUTEX("LLMutexBase::lock()");
|
||||
|
||||
void LLMutexBase::lock()
|
||||
{
|
||||
if (mLockingThread.equals_current_thread_inline())
|
||||
@@ -418,7 +429,18 @@ void LLMutexBase::lock()
|
||||
return;
|
||||
}
|
||||
|
||||
apr_thread_mutex_lock(mAPRMutexp);
|
||||
if (APR_STATUS_IS_EBUSY(apr_thread_mutex_trylock(mAPRMutexp)))
|
||||
{
|
||||
if (AIThreadID::in_main_thread_inline())
|
||||
{
|
||||
LLFastTimer ft1(FT_WAIT_FOR_MUTEX);
|
||||
apr_thread_mutex_lock(mAPRMutexp);
|
||||
}
|
||||
else
|
||||
{
|
||||
apr_thread_mutex_lock(mAPRMutexp);
|
||||
}
|
||||
}
|
||||
|
||||
mLockingThread.reset_inline();
|
||||
}
|
||||
|
||||
@@ -262,6 +262,11 @@ U64 totalTime()
|
||||
// No wrapping, we're all okay.
|
||||
gTotalTimeClockCount += current_clock_count - gLastTotalTimeClockCount;
|
||||
}
|
||||
else if((gLastTotalTimeClockCount - current_clock_count)<0xFFFF)
|
||||
{
|
||||
//clock is glitching and walking backwards - ignore it
|
||||
gTotalTimeClockCount = gLastTotalTimeClockCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We've wrapped. Compensate correctly
|
||||
|
||||
Reference in New Issue
Block a user