linux and tests

fix linux build
change thread test to use TorqueThreadPool
This commit is contained in:
marauder2k7 2024-05-12 16:31:30 +01:00
parent 948d2e5cef
commit 399844f7f1
2 changed files with 6 additions and 6 deletions

View file

@ -30,7 +30,7 @@ FIXTURE(ThreadPool)
public: public:
// Represents a single unit of work. In this test we just set an element in // Represents a single unit of work. In this test we just set an element in
// a result vector. // a result vector.
struct TestItem : public ThreadPool::WorkItem struct TestItem : public TorqueThreadPool::WorkItem
{ {
U32 mIndex; U32 mIndex;
Vector<U32>& mResults; Vector<U32>& mResults;
@ -46,7 +46,7 @@ public:
// A worker that delays for some time. We'll use this to test the ThreadPool's // A worker that delays for some time. We'll use this to test the ThreadPool's
// synchronous and asynchronous operations. // synchronous and asynchronous operations.
struct DelayItem : public ThreadPool::WorkItem struct DelayItem : public TorqueThreadPool::WorkItem
{ {
U32 ms; U32 ms;
DelayItem(U32 _ms) : ms(_ms) {} DelayItem(U32 _ms) : ms(_ms) {}
@ -69,7 +69,7 @@ TEST_FIX(ThreadPool, BasicAPI)
results[i] = U32(-1); results[i] = U32(-1);
// Launch the work items. // Launch the work items.
ThreadPool* pool = &ThreadPool::GLOBAL(); TorqueThreadPool* pool = &TorqueThreadPool::GLOBAL();
for (U32 i = 0; i < numItems; i++) for (U32 i = 0; i < numItems; i++)
{ {
ThreadSafeRef<TestItem> item(new TestItem(i, results)); ThreadSafeRef<TestItem> item(new TestItem(i, results));
@ -89,7 +89,7 @@ TEST_FIX(ThreadPool, Asynchronous)
const U32 delay = 500; //ms const U32 delay = 500; //ms
// Launch a single delaying work item. // Launch a single delaying work item.
ThreadPool* pool = &ThreadPool::GLOBAL(); TorqueThreadPool* pool = &TorqueThreadPool::GLOBAL();
ThreadSafeRef<DelayItem> item(new DelayItem(delay)); ThreadSafeRef<DelayItem> item(new DelayItem(delay));
pool->queueWorkItem(item); pool->queueWorkItem(item);
@ -107,7 +107,7 @@ TEST_FIX(ThreadPool, Synchronous)
const U32 delay = 500; //ms const U32 delay = 500; //ms
// Launch a single delaying work item. // Launch a single delaying work item.
ThreadPool* pool = &ThreadPool::GLOBAL(); TorqueThreadPool* pool = &TorqueThreadPool::GLOBAL();
ThreadSafeRef<DelayItem> item(new DelayItem(delay)); ThreadSafeRef<DelayItem> item(new DelayItem(delay));
pool->queueWorkItem(item); pool->queueWorkItem(item);

View file

@ -28,7 +28,7 @@
#define ENABLE_VHACD_IMPLEMENTATION 1 #define ENABLE_VHACD_IMPLEMENTATION 1
#define VHACD_DISABLE_THREADING 0 #define VHACD_DISABLE_THREADING 0
#include <VHACD.H> #include "ts/vhacd/VHACD.h"
#include <FloatMath.h> #include <FloatMath.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------