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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user