Update AMTL, replace ke::Deque with std::deque.

This commit is contained in:
David Anderson 2020-05-30 12:31:02 -07:00
parent 75fa198321
commit 979e410efc
5 changed files with 13 additions and 13 deletions

View File

@ -886,7 +886,7 @@ void PlayerManager::OnClientPrintf(edict_t *pEdict, const char *szMsg)
if (player.m_PrintfBuffer.empty()) if (player.m_PrintfBuffer.empty())
g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(uintptr_t)player.GetSerial()); 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); 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()); 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()) if (!player.m_PrintfBuffer.empty())
@ -2245,7 +2245,7 @@ void CPlayer::Disconnect()
void CPlayer::ClearNetchannelQueue(void) void CPlayer::ClearNetchannelQueue(void)
{ {
while (!m_PrintfBuffer.empty()) while (!m_PrintfBuffer.empty())
m_PrintfBuffer.popFront(); m_PrintfBuffer.pop_front();
} }
void CPlayer::SetName(const char *name) void CPlayer::SetName(const char *name)

View File

@ -1,5 +1,5 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sts=8 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2015 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2015 AlliedModders LLC. All rights reserved.
@ -154,7 +154,7 @@ private:
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie; QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie;
#endif #endif
ke::Deque<std::string> m_PrintfBuffer; std::deque<std::string> m_PrintfBuffer;
}; };
class PlayerManager : class PlayerManager :

View File

@ -74,7 +74,7 @@ class CompatWorker final : public IThreadWorker
WorkerState state_; WorkerState state_;
std::mutex mutex_; std::mutex mutex_;
std::condition_variable work_cv_; std::condition_variable work_cv_;
ke::Deque<SWThreadHandle*> work_; std::deque<SWThreadHandle*> work_;
std::unique_ptr<std::thread> thread_; std::unique_ptr<std::thread> thread_;
std::atomic<unsigned int> jobs_per_wakeup_; std::atomic<unsigned int> jobs_per_wakeup_;
std::atomic<unsigned int> wait_between_jobs_; std::atomic<unsigned int> wait_between_jobs_;
@ -152,7 +152,7 @@ bool CompatWorker::Unpause()
void CompatWorker::Flush() void CompatWorker::Flush()
{ {
while (!work_.empty()) { while (!work_.empty()) {
auto handle = work_.popFrontCopy(); auto handle = ke::PopFront(&work_);
handle->GetThread()->OnTerminate(handle, true); handle->GetThread()->OnTerminate(handle, true);
if (handle->m_params.flags & Thread_AutoRelease) if (handle->m_params.flags & Thread_AutoRelease)
delete handle; delete handle;
@ -202,7 +202,7 @@ void CompatWorker::Worker()
assert(state_ == Worker_Running); assert(state_ == Worker_Running);
assert(!work_.empty()); assert(!work_.empty());
SWThreadHandle* handle = work_.popFrontCopy(); SWThreadHandle* handle = ke::PopFront(&work_);
RunWorkLocked(&lock, handle); RunWorkLocked(&lock, handle);
work_in_frame++; work_in_frame++;
@ -217,7 +217,7 @@ void CompatWorker::Worker()
assert(lock.owns_lock()); assert(lock.owns_lock());
while (!work_.empty()) { while (!work_.empty()) {
SWThreadHandle* handle = work_.popFrontCopy(); SWThreadHandle* handle = ke::PopFront(&work_);
RunWorkLocked(&lock, handle); RunWorkLocked(&lock, handle);
} }
} }
@ -231,7 +231,7 @@ unsigned int CompatWorker::RunFrame()
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
if (work_.empty()) if (work_.empty())
break; break;
handle = work_.popFrontCopy(); handle = ke::PopFront(&work_);
} }
RunWork(handle); RunWork(handle);
@ -284,7 +284,7 @@ IThreadHandle *CompatWorker::MakeThread(IThread *pThread, const ThreadParams *pa
return nullptr; return nullptr;
SWThreadHandle* handle = new SWThreadHandle(this, params, pThread); SWThreadHandle* handle = new SWThreadHandle(this, params, pThread);
work_.append(handle); work_.push_back(handle);
work_cv_.notify_one(); work_cv_.notify_one();
return handle; return handle;
} }

@ -1 +1 @@
Subproject commit 4a5458ab7d28a21792b8ae4bcd23656873f94743 Subproject commit 3590cb38ee942cbd3a52adfcef4d26493d63f14b

@ -1 +1 @@
Subproject commit 6e5e5f6abbc350a131f6b9d23adb68fdb9ba8b86 Subproject commit 0054031d1da031f136525ad776b639bc38017c22