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

This commit is contained in:
David Anderson
2020-05-30 12:44:02 -07:00
parent 75fa198321
commit 979e410efc
5 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -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)
+2 -2
View File
@@ -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<std::string> m_PrintfBuffer;
std::deque<std::string> m_PrintfBuffer;
};
class PlayerManager :
+6 -6
View File
@@ -74,7 +74,7 @@ class CompatWorker final : public IThreadWorker
WorkerState state_;
std::mutex mutex_;
std::condition_variable work_cv_;
ke::Deque<SWThreadHandle*> work_;
std::deque<SWThreadHandle*> work_;
std::unique_ptr<std::thread> thread_;
std::atomic<unsigned int> jobs_per_wakeup_;
std::atomic<unsigned int> 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<std::mutex> 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;
}