16 #ifndef BT_POSIX_THREAD_SUPPORT_H
17 #define BT_POSIX_THREAD_SUPPORT_H
23 #ifdef USE_PTHREADS //platform specifc defines are defined in PlatformDefinitions.h
26 #define _XOPEN_SOURCE 600 //for definition of pthread_barrier_t, see http://pages.cs.wisc.edu/~travitch/pthreads_primer.html
27 #endif //_XOPEN_SOURCE
29 #include <semaphore.h>
39 typedef void* (*PosixlsMemorySetupFunc)();
81 int threadStackSize=65535
112 virtual void waitForResponse(
unsigned int *puiArgument0,
unsigned int *puiArgument1);
143 #endif // USE_PTHREADS
145 #endif // BT_POSIX_THREAD_SUPPORT_H
virtual btCriticalSection * createCriticalSection()
PosixlsMemorySetupFunc m_lsMemoryFunc
void startThreads(ThreadConstructionInfo &threadInfo)
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
virtual void deleteBarrier(btBarrier *barrier)
virtual btBarrier * createBarrier()
virtual ~PosixThreadSupport()
cleanup/shutdown Libspe2
PosixThreadFunc m_userThreadFunc
void(* PosixThreadFunc)(void *userPtr, void *lsMemory)
virtual void * getThreadLocalMemory(int taskId)
void *(* PosixlsMemorySetupFunc)()
PosixThreadFunc m_userThreadFunc
virtual int getNumTasks() const
enum PosixThreadSupport::sStatus Status
virtual void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
check for messages from SPUs
PosixThreadSupport(ThreadConstructionInfo &threadConstructionInfo)
const char * m_uniqueName
btAlignedObjectArray< btSpuStatus > m_activeSpuStatus
ThreadConstructionInfo(const char *uniqueName, PosixThreadFunc userThreadFunc, PosixlsMemorySetupFunc lsMemoryFunc, int numThreads=1, int threadStackSize=65535)
virtual void stopSPU()
tell the task scheduler we are done with the SPU tasks
Setup and initialize SPU/CELL/Libspe2.
virtual void deleteCriticalSection(btCriticalSection *criticalSection)
static void barrier(unsigned int a)
virtual void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1)
send messages to SPUs
virtual void setNumTasks(int numTasks)
tell the task scheduler to use no more than numTasks tasks
virtual void startSPU()
start the spus (can be called at the beginning of each frame, to make sure that the right SPU program...