summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-09-16 12:18:16 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-09-16 12:18:16 -0400
commit50896aafe53759ed0b5b8bcd4a835957dd2a0e4f (patch)
treeaca350fe09949fcb30e42b384a85ab94d1602bc4
parentfa70b619efcdaad27db6548f9eed235e191bd4ec (diff)
parent2fba01d160716b886a7dfc0c86abda767a25d23f (diff)
merge
-rw-r--r--indra/llcommon/llthread.h3
-rw-r--r--indra/llmessage/llcurl.cpp6
-rwxr-xr-x[-rw-r--r--]indra/llmessage/llcurl.h2
-rw-r--r--indra/newview/app_settings/settings.xml13
-rwxr-xr-xindra/newview/llagent.cpp6
-rw-r--r--indra/newview/llagent.h3
-rw-r--r--indra/newview/llappviewer.cpp18
-rw-r--r--indra/newview/llsecapi.h8
-rw-r--r--indra/newview/llviewerjoystick.cpp11
-rw-r--r--indra/newview/llviewerwindow.cpp7
10 files changed, 32 insertions, 45 deletions
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index c732e3bc77..b631b96252 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -195,7 +195,8 @@ public:
}
~LLMutex()
{
- llassert(!isLocked()); // better not be locked!
+ //this assertion erroneously triggers whenever an LLCondition is destroyed
+ //llassert(!isLocked()); // better not be locked!
apr_thread_mutex_destroy(mAPRMutexp);
mAPRMutexp = NULL;
}
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 14e169c6b1..280a8942a8 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -222,7 +222,7 @@ namespace boost
std::set<CURL*> LLCurl::Easy::sFreeHandles;
std::set<CURL*> LLCurl::Easy::sActiveHandles;
LLMutex* LLCurl::Easy::sHandleMutex = NULL;
-
+LLMutex* LLCurl::Easy::sMultiMutex = NULL;
//static
CURL* LLCurl::Easy::allocEasyHandle()
@@ -606,6 +606,7 @@ void LLCurl::Multi::run()
mPerformState = PERFORM_STATE_PERFORMING;
if (!mQuitting)
{
+ LLMutexLock lock(LLCurl::Easy::sMultiMutex);
doPerform();
}
}
@@ -1179,6 +1180,7 @@ void LLCurl::initClass(bool multi_threaded)
check_curl_code(code);
Easy::sHandleMutex = new LLMutex();
+ Easy::sMultiMutex = new LLMutex();
#if SAFE_SSL
S32 mutex_count = CRYPTO_num_locks();
@@ -1200,6 +1202,8 @@ void LLCurl::cleanupClass()
delete Easy::sHandleMutex;
Easy::sHandleMutex = NULL;
+ delete Easy::sMultiMutex;
+ Easy::sMultiMutex = NULL;
for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
{
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 213b281e72..87de202717 100644..100755
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -232,6 +232,7 @@ public:
private:
friend class LLCurl;
+ friend class LLCurl::Multi;
CURL* mCurlEasyHandle;
struct curl_slist* mHeaders;
@@ -251,6 +252,7 @@ private:
static std::set<CURL*> sFreeHandles;
static std::set<CURL*> sActiveHandles;
static LLMutex* sHandleMutex;
+ static LLMutex* sMultiMutex;
};
class LLCurl::Multi : public LLThread
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e4169c0cba..8804c40aff 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -25,7 +25,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <real>0</real>
+ <real>300</real>
</map>
<key>AdminMenu</key>
<map>
@@ -7116,17 +7116,6 @@
<key>Value</key>
<real>0.0</real>
</map>
- <key>QuitAfterSecondsOfAFK</key>
- <map>
- <key>Comment</key>
- <string>The duration allowed after being AFK before quitting.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>0.0</real>
- </map>
<key>QuitOnLoginActivated</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 642a1907f0..296ae8f10b 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -107,7 +107,6 @@ const F64 CHAT_AGE_FAST_RATE = 3.0;
const F32 MIN_FIDGET_TIME = 8.f; // seconds
const F32 MAX_FIDGET_TIME = 20.f; // seconds
-
// The agent instance.
LLAgent gAgent;
@@ -115,6 +114,9 @@ LLAgent gAgent;
// Statics
//
+/// minimum time after setting away state before coming back based on movement
+const F32 LLAgent::MIN_AFK_TIME = 10.0f;
+
const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f;
std::map<std::string, std::string> LLAgent::sTeleportErrorMessages;
@@ -1165,6 +1167,7 @@ void LLAgent::setAFK()
{
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START);
setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP);
+ LL_INFOS("AFK") << "Setting Away" << LL_ENDL;
gAwayTimer.start();
if (gAFKMenu)
{
@@ -1188,6 +1191,7 @@ void LLAgent::clearAFK()
{
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP);
clearControlFlags(AGENT_CONTROL_AWAY);
+ LL_INFOS("AFK") << "Clearing Away" << LL_ENDL;
if (gAFKMenu)
{
gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway"));
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 67ed1923c0..5e23ced424 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -318,7 +318,8 @@ public:
void setAFK();
void clearAFK();
BOOL getAFK() const;
-
+ static const F32 MIN_AFK_TIME;
+
//--------------------------------------------------------------------
// Run
//--------------------------------------------------------------------
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4e1ef59765..2e1108d42c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -247,7 +247,6 @@ extern BOOL gDebugGL;
////////////////////////////////////////////////////////////
// All from the last globals push...
-const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard
F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
F32 gSimFrames;
@@ -430,8 +429,11 @@ static bool app_metrics_qa_mode = false;
void idle_afk_check()
{
// check idle timers
- if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout")))
+ F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
+ F32 afk_timeout = gSavedSettings.getS32("AFKTimeout");
+ if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK())
{
+ LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
gAgent.setAFK();
}
}
@@ -4186,18 +4188,6 @@ void LLAppViewer::idle()
}
}
- // debug setting to quit after N seconds of being AFK - 0 to never do this
- F32 qas_afk = gSavedSettings.getF32("QuitAfterSecondsOfAFK");
- if (qas_afk > 0.f)
- {
- // idle time is more than setting
- if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk )
- {
- // go ahead and just quit gracefully
- LLAppViewer::instance()->requestQuit();
- }
- }
-
// Must wait until both have avatar object and mute list, so poll
// here.
request_initial_instant_messages();
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index 0935a0005b..db57848320 100644
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -132,7 +132,7 @@ protected:
// LLCertificates are considered unmodifiable
// Certificates are pulled out of stores, or created via
// factory calls
-class LLCertificate : public LLRefCount
+class LLCertificate : public LLThreadSafeRefCount
{
LOG_CLASS(LLCertificate);
public:
@@ -170,7 +170,7 @@ public:
// base iterator implementation class, providing
// the functionality needed for the iterator class.
- class iterator_impl : public LLRefCount
+ class iterator_impl : public LLThreadSafeRefCount
{
public:
iterator_impl() {};
@@ -289,7 +289,7 @@ bool operator!=(const LLCertificateVector::iterator& _lhs, const LLCertificateVe
// * Persistence of credential information based on grid (for saving username/password)
// * Serialization to an OGP identifier/authenticator pair
//
-class LLCredential : public LLRefCount
+class LLCredential : public LLThreadSafeRefCount
{
public:
@@ -424,7 +424,7 @@ protected:
// LLSecAPIHandler Class
// Interface handler class for the various security storage handlers.
-class LLSecAPIHandler : public LLRefCount
+class LLSecAPIHandler : public LLThreadSafeRefCount
{
public:
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index fbf11f20db..f6e840adcd 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -51,9 +51,6 @@
#define RY_I 5
#define RZ_I 3
-// minimum time after setting away state before coming back
-const F32 MIN_AFK_TIME = 2.f;
-
F32 LLViewerJoystick::sLastDelta[] = {0,0,0,0,0,0,0};
F32 LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0};
@@ -551,7 +548,7 @@ void LLViewerJoystick::moveObjects(bool reset)
if (!is_zero)
{
// Clear AFK state if moved beyond the deadzone
- if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
@@ -725,7 +722,7 @@ void LLViewerJoystick::moveAvatar(bool reset)
if (!is_zero)
{
// Clear AFK state if moved beyond the deadzone
- if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
@@ -941,7 +938,7 @@ void LLViewerJoystick::moveFlycam(bool reset)
}
// Clear AFK state if moved beyond the deadzone
- if (!is_zero && gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
@@ -1001,7 +998,7 @@ bool LLViewerJoystick::toggleFlycam()
gAgentCamera.changeCameraToDefault();
}
- if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5893259d96..a7f4209e69 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -240,8 +240,6 @@ BOOL gDisplayBadge = FALSE;
static const U8 NO_FACE = 255;
BOOL gQuietSnapshot = FALSE;
-const F32 MIN_AFK_TIME = 2.f; // minimum time after setting away state before coming back
-
static const F32 MIN_DISPLAY_SCALE = 0.75f;
std::string LLViewerWindow::sSnapshotBaseName;
@@ -1214,7 +1212,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
mWindow->showCursorFromMouseMove();
- if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
@@ -1302,7 +1300,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
// Let the voice chat code check for its PTT key. Note that this never affects event processing.
LLVoiceClient::getInstance()->keyDown(key, mask);
- if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
@@ -1352,6 +1350,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
{
mActive = FALSE;
+ // if the user has chosen to go Away automatically after some time, then go Away when minimizing
if (gSavedSettings.getS32("AFKTimeout"))
{
gAgent.setAFK();