fix old threading examples
This commit is contained in:
@@ -29,6 +29,7 @@ void SamplelsMemoryReleaseFunc(void* ptr);
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include "b3PosixThreadSupport.h"
|
#include "b3PosixThreadSupport.h"
|
||||||
|
|
||||||
|
|
||||||
b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
||||||
{
|
{
|
||||||
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
void SampleThreadFunc(void* userPtr, void* lsMemory);
|
void SampleThreadFunc(void* userPtr, void* lsMemory);
|
||||||
void* SamplelsMemoryFunc();
|
void* SamplelsMemoryFunc();
|
||||||
|
void SamplelsMemoryReleaseFunc(void* ptr);
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
//#include "BulletMultiThreaded/PlatformDefinitions.h"
|
//#include "BulletMultiThreaded/PlatformDefinitions.h"
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
|||||||
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
||||||
SampleThreadFunc,
|
SampleThreadFunc,
|
||||||
SamplelsMemoryFunc,
|
SamplelsMemoryFunc,
|
||||||
|
SamplelsMemoryReleaseFunc,
|
||||||
numThreads);
|
numThreads);
|
||||||
b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo);
|
b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo);
|
||||||
|
|
||||||
@@ -99,6 +100,13 @@ void* SamplelsMemoryFunc()
|
|||||||
return new SampleThreadLocalStorage;
|
return new SampleThreadLocalStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SamplelsMemoryReleaseFunc(void* ptr)
|
||||||
|
{
|
||||||
|
SampleThreadLocalStorage* p = (SampleThreadLocalStorage*)ptr;
|
||||||
|
delete p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int numThreads = 8;
|
int numThreads = 8;
|
||||||
|
|||||||
Reference in New Issue
Block a user