diff options
| author | Andrey Lihatskiy <118752495+marchcat@users.noreply.github.com> | 2026-05-21 20:03:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-21 20:03:14 +0300 |
| commit | 627bb8feff264a6077dcf435e5656145d566e94a (patch) | |
| tree | 55af7639161926313434d9e4a8b9872369668d5d /indra/newview/llaisapi.cpp | |
| parent | ff536adef0b74c20f55bd501ad593e4eef762082 (diff) | |
| parent | 15d82beb6056fa16a1ea1cbf01c5d673a95e0267 (diff) | |
Merge pull request #5852 from secondlife/marchcat/slua-26.2
26.2 -> SLua viewer
Diffstat (limited to 'indra/newview/llaisapi.cpp')
| -rw-r--r-- | indra/newview/llaisapi.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 9c76f56ef3..f67f2688a1 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -1019,6 +1019,9 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht } //------------------------------------------------------------------------- +U32 AISUpdate::sBatchFrameCount = 0; +LLTimer AISUpdate::sBatchTimer; + AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD& request_body) : mType(type) { @@ -1036,8 +1039,16 @@ AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD& mFetchDepth = request_body["depth"].asInteger(); } - mTimer.setTimerExpirySec(AIS_EXPIRY_SECONDS); - mTimer.start(); + mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS); + mTaskTimer.start(); + + U32 current_frame = LLFrameTimer::getFrameCount(); + if (sBatchFrameCount != current_frame) + { + sBatchTimer.setTimerExpirySec(AIS_BATCH_EXPIRY_SECONDS); + sBatchTimer.start(); + sBatchFrameCount = current_frame; + } parseUpdate(update); } @@ -1058,7 +1069,7 @@ void AISUpdate::clearParseResults() void AISUpdate::checkTimeout() { - if (mTimer.hasExpired()) + if (mTaskTimer.hasExpired() || sBatchTimer.hasExpired()) { // If we are taking too long, don't starve other tasks, // yield to mainloop. @@ -1067,7 +1078,16 @@ void AISUpdate::checkTimeout() // a chance, so wait for a frame tick instead. llcoro::suspendUntilNextFrame(); LLCoros::checkStop(); - mTimer.setTimerExpirySec(AIS_EXPIRY_SECONDS); + mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS); + + U32 current_frame = LLFrameTimer::getFrameCount(); + if (sBatchFrameCount != current_frame) + { + // To give other tasks a chance batch timer + // has a longer delay. + sBatchTimer.setTimerExpirySec(AIS_BATCH_EXPIRY_SECONDS); + sBatchFrameCount = current_frame; + } } } |
