2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

Various bug fixes

This commit is contained in:
Jack Andersen
2017-10-21 20:10:59 -10:00
parent ebad51dc2e
commit 48ec4cf6eb
10 changed files with 52 additions and 26 deletions

View File

@@ -10,10 +10,14 @@
#include <sys/wait.h>
#endif
#define HECL_MULTIPROCESSOR 1
namespace hecl
{
static logvisor::Module Log("hecl::ClientProcess");
ThreadLocalPtr<ClientProcess::Worker> ClientProcess::ThreadWorker;
static int GetCPUCount()
{
#if _WIN32
@@ -68,6 +72,8 @@ ClientProcess::Worker::Worker(ClientProcess& proc, int idx)
void ClientProcess::Worker::proc()
{
ClientProcess::ThreadWorker.reset(this);
char thrName[64];
snprintf(thrName, 64, "HECL Client Worker %d", m_idx);
logvisor::RegisterThreadName(thrName);
@@ -172,7 +178,7 @@ void ClientProcess::swapCompletedQueue(std::list<std::shared_ptr<Transaction>>&
void ClientProcess::waitUntilComplete()
{
std::unique_lock<std::mutex> lk(m_mutex);
while (m_pendingQueue.size() || m_inProgress)
while (isBusy())
m_waitCv.wait(lk);
}