Bullet Collision Detection & Physics Library
Classes | Macros | Functions | Variables
btThreads.cpp File Reference
#include "btThreads.h"
#include "btQuickprof.h"
#include <algorithm>
Include dependency graph for btThreads.cpp:

Go to the source code of this file.

Classes

struct  ThreadsafeCounter
 
class  btTaskSchedulerSequential
 btTaskSchedulerSequential – non-threaded implementation of task scheduler (really just useful for testing performance of single threaded vs multi) More...
 

Macros

#define THREAD_LOCAL_STATIC   static
 
#define BT_DETECT_BAD_THREAD_INDEX   0
 

Functions

unsigned int btGetCurrentThreadIndex ()
 
bool btIsMainThread ()
 
void btResetThreadIndexCounter ()
 
void btPushThreadsAreRunning ()
 
void btPopThreadsAreRunning ()
 
bool btThreadsAreRunning ()
 
void btSetTaskScheduler (btITaskScheduler *ts)
 
btITaskSchedulerbtGetTaskScheduler ()
 
void btParallelFor (int iBegin, int iEnd, int grainSize, const btIParallelForBody &body)
 
btScalar btParallelSum (int iBegin, int iEnd, int grainSize, const btIParallelSumBody &body)
 
btITaskSchedulerbtGetSequentialTaskScheduler ()
 
btITaskSchedulerbtGetOpenMPTaskScheduler ()
 
btITaskSchedulerbtGetTBBTaskScheduler ()
 
btITaskSchedulerbtGetPPLTaskScheduler ()
 

Variables

static btITaskSchedulergBtTaskScheduler =0
 
static int gThreadsRunningCounter = 0
 
static btSpinMutex gThreadsRunningCounterMutex
 
static ThreadsafeCounter gThreadCounter
 

Macro Definition Documentation

◆ BT_DETECT_BAD_THREAD_INDEX

#define BT_DETECT_BAD_THREAD_INDEX   0

Definition at line 274 of file btThreads.cpp.

◆ THREAD_LOCAL_STATIC

#define THREAD_LOCAL_STATIC   static

Definition at line 212 of file btThreads.cpp.

Function Documentation

◆ btGetCurrentThreadIndex()

unsigned int btGetCurrentThreadIndex ( )

Definition at line 290 of file btThreads.cpp.

◆ btGetOpenMPTaskScheduler()

btITaskScheduler * btGetOpenMPTaskScheduler ( )

Definition at line 762 of file btThreads.cpp.

◆ btGetPPLTaskScheduler()

btITaskScheduler * btGetPPLTaskScheduler ( )

Definition at line 784 of file btThreads.cpp.

◆ btGetSequentialTaskScheduler()

btITaskScheduler * btGetSequentialTaskScheduler ( )

Definition at line 755 of file btThreads.cpp.

◆ btGetTaskScheduler()

btITaskScheduler * btGetTaskScheduler ( )

Definition at line 407 of file btThreads.cpp.

◆ btGetTBBTaskScheduler()

btITaskScheduler * btGetTBBTaskScheduler ( )

Definition at line 773 of file btThreads.cpp.

◆ btIsMainThread()

bool btIsMainThread ( )

Definition at line 324 of file btThreads.cpp.

◆ btParallelFor()

void btParallelFor ( int  iBegin,
int  iEnd,
int  grainSize,
const btIParallelForBody body 
)

Definition at line 412 of file btThreads.cpp.

◆ btParallelSum()

btScalar btParallelSum ( int  iBegin,
int  iEnd,
int  grainSize,
const btIParallelSumBody body 
)

Definition at line 439 of file btThreads.cpp.

◆ btPopThreadsAreRunning()

void btPopThreadsAreRunning ( )

Definition at line 374 of file btThreads.cpp.

◆ btPushThreadsAreRunning()

void btPushThreadsAreRunning ( )

Definition at line 367 of file btThreads.cpp.

◆ btResetThreadIndexCounter()

void btResetThreadIndexCounter ( )

Definition at line 329 of file btThreads.cpp.

◆ btSetTaskScheduler()

void btSetTaskScheduler ( btITaskScheduler ts)

Definition at line 386 of file btThreads.cpp.

◆ btThreadsAreRunning()

bool btThreadsAreRunning ( )

Definition at line 381 of file btThreads.cpp.

Variable Documentation

◆ gBtTaskScheduler

btITaskScheduler* gBtTaskScheduler =0
static

Definition at line 244 of file btThreads.cpp.

◆ gThreadCounter

ThreadsafeCounter gThreadCounter
static

Definition at line 247 of file btThreads.cpp.

◆ gThreadsRunningCounter

int gThreadsRunningCounter = 0
static

Definition at line 245 of file btThreads.cpp.

◆ gThreadsRunningCounterMutex

btSpinMutex gThreadsRunningCounterMutex
static

Definition at line 246 of file btThreads.cpp.