Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/PhoenixCore/Private/Parallel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@

#include "Parallel.h"

#ifdef __EMSCRIPTEN__
// Original implementation would go here for non-web builds
// For web builds, we'll provide simplified stubs

// Web build stubs
namespace Phoenix
{
namespace Threading
{
void SpinWait(uint32 cycles)
{
// No-op for web builds
}
}
}

#else
// Web build stubs
namespace Phoenix
{
namespace Threading
{
void SpinWait(uint32 cycles)
{
// No-op for web builds
}
}
}

// xatomic.h is Windows-specific, using standard <atomic> and <thread> from Parallel.h

#include "PhoenixCore.h"
Expand Down Expand Up @@ -137,3 +166,7 @@ void ThreadPool::Worker(size_t workerId)
ActiveWorkerCount.fetch_sub(1, std::memory_order_acq_rel);
}
}

#endif


2 changes: 1 addition & 1 deletion src/PhoenixSim/Private/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void Session::Tick(const SessionStepArgs& args)
break;
}

AccTickTime -= std::max(hz, stepElapsed);
AccTickTime -= std::max(static_cast<clock_t>(hz), stepElapsed);
CurrTickTime = clock();
}

Expand Down