From 979e410efc5675ba90cd45b971869e3187de82b6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 30 May 2020 12:31:02 -0700 Subject: [PATCH] Update AMTL, replace ke::Deque with std::deque. --- core/PlayerManager.cpp | 6 +++--- core/PlayerManager.h | 4 ++-- core/logic/ThreadSupport.cpp | 12 ++++++------ public/amtl | 2 +- sourcepawn | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index c743adac..0dca81d5 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -886,7 +886,7 @@ void PlayerManager::OnClientPrintf(edict_t *pEdict, const char *szMsg) if (player.m_PrintfBuffer.empty()) g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(uintptr_t)player.GetSerial()); - player.m_PrintfBuffer.append(szMsg); + player.m_PrintfBuffer.push_back(szMsg); RETURN_META(MRES_SUPERCEDE); } @@ -927,7 +927,7 @@ void PlayerManager::OnPrintfFrameAction(unsigned int serial) SH_CALL(engine, &IVEngineServer::ClientPrintf)(player.m_pEdict, string.c_str()); - player.m_PrintfBuffer.popFront(); + player.m_PrintfBuffer.pop_front(); } if (!player.m_PrintfBuffer.empty()) @@ -2245,7 +2245,7 @@ void CPlayer::Disconnect() void CPlayer::ClearNetchannelQueue(void) { while (!m_PrintfBuffer.empty()) - m_PrintfBuffer.popFront(); + m_PrintfBuffer.pop_front(); } void CPlayer::SetName(const char *name) diff --git a/core/PlayerManager.h b/core/PlayerManager.h index 876a17e1..d0cfda28 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sts=8 sw=4 tw=99 noet : * ============================================================================= * SourceMod * Copyright (C) 2004-2015 AlliedModders LLC. All rights reserved. @@ -154,7 +154,7 @@ private: #if SOURCE_ENGINE == SE_CSGO QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie; #endif - ke::Deque m_PrintfBuffer; + std::deque m_PrintfBuffer; }; class PlayerManager : diff --git a/core/logic/ThreadSupport.cpp b/core/logic/ThreadSupport.cpp index 29f2fd5b..e2bbdbee 100644 --- a/core/logic/ThreadSupport.cpp +++ b/core/logic/ThreadSupport.cpp @@ -74,7 +74,7 @@ class CompatWorker final : public IThreadWorker WorkerState state_; std::mutex mutex_; std::condition_variable work_cv_; - ke::Deque work_; + std::deque work_; std::unique_ptr thread_; std::atomic jobs_per_wakeup_; std::atomic wait_between_jobs_; @@ -152,7 +152,7 @@ bool CompatWorker::Unpause() void CompatWorker::Flush() { while (!work_.empty()) { - auto handle = work_.popFrontCopy(); + auto handle = ke::PopFront(&work_); handle->GetThread()->OnTerminate(handle, true); if (handle->m_params.flags & Thread_AutoRelease) delete handle; @@ -202,7 +202,7 @@ void CompatWorker::Worker() assert(state_ == Worker_Running); assert(!work_.empty()); - SWThreadHandle* handle = work_.popFrontCopy(); + SWThreadHandle* handle = ke::PopFront(&work_); RunWorkLocked(&lock, handle); work_in_frame++; @@ -217,7 +217,7 @@ void CompatWorker::Worker() assert(lock.owns_lock()); while (!work_.empty()) { - SWThreadHandle* handle = work_.popFrontCopy(); + SWThreadHandle* handle = ke::PopFront(&work_); RunWorkLocked(&lock, handle); } } @@ -231,7 +231,7 @@ unsigned int CompatWorker::RunFrame() std::lock_guard lock(mutex_); if (work_.empty()) break; - handle = work_.popFrontCopy(); + handle = ke::PopFront(&work_); } RunWork(handle); @@ -284,7 +284,7 @@ IThreadHandle *CompatWorker::MakeThread(IThread *pThread, const ThreadParams *pa return nullptr; SWThreadHandle* handle = new SWThreadHandle(this, params, pThread); - work_.append(handle); + work_.push_back(handle); work_cv_.notify_one(); return handle; } diff --git a/public/amtl b/public/amtl index 4a5458ab..3590cb38 160000 --- a/public/amtl +++ b/public/amtl @@ -1 +1 @@ -Subproject commit 4a5458ab7d28a21792b8ae4bcd23656873f94743 +Subproject commit 3590cb38ee942cbd3a52adfcef4d26493d63f14b diff --git a/sourcepawn b/sourcepawn index 6e5e5f6a..0054031d 160000 --- a/sourcepawn +++ b/sourcepawn @@ -1 +1 @@ -Subproject commit 6e5e5f6abbc350a131f6b9d23adb68fdb9ba8b86 +Subproject commit 0054031d1da031f136525ad776b639bc38017c22