RobWorkProject  23.9.11-
Static Public Member Functions | List of all members
ODEThreading Class Reference

Utility functions related to the use of Open Dynamics Engine from multiple threads. More...

#include <ODEThreading.hpp>

Static Public Member Functions

static void assertSupported ()
 Make sure that threading is supported. More...
 
static bool isSupported ()
 Check if threading is supported. More...
 
static void checkSecureStepBegin ()
 If multiple threads try to execute dWorldStep or dWorldQuickStep simultaneously, they should call this before each step, followed by checkSecureStepEnd() after the step. This will give user-friendly errors if threading is not supported. More...
 
static void checkSecureStepEnd ()
 Call this after all dWorldStep and dWorldQuickStep. More...
 
static void initThreading (dWorldID world)
 Initialize threading structures (only used in ODE 0.13 and newer). More...
 
static void destroyThreading (dWorldID world)
 Destruct threading structures. More...
 

Detailed Description

Utility functions related to the use of Open Dynamics Engine from multiple threads.

For version 0.12 and earlier, using ODE from multiple threads might work (there is no guarantees).

In version 0.13 a new structure for multi-threading was introduced. Open Dynamics Engine must be compiled with the flags –enable-builtin-threading-impl and –enable-ou. This is required to support multi-threading in ODE 0.13 and newer.

Member Function Documentation

◆ assertSupported()

static void assertSupported ( )
static

Make sure that threading is supported.

Exceptions
Exceptionif Open Dynamics Engine does not support threading.
See also
isSupported

◆ checkSecureStepBegin()

static void checkSecureStepBegin ( )
static

If multiple threads try to execute dWorldStep or dWorldQuickStep simultaneously, they should call this before each step, followed by checkSecureStepEnd() after the step. This will give user-friendly errors if threading is not supported.

Exceptions
Exceptionif threading is not supported and this has been called more than once.

◆ checkSecureStepEnd()

static void checkSecureStepEnd ( )
static

Call this after all dWorldStep and dWorldQuickStep.

See also
checkSecureStepBegin

◆ destroyThreading()

static void destroyThreading ( dWorldID  world)
static

Destruct threading structures.

Parameters
world[in] the world id.

◆ initThreading()

static void initThreading ( dWorldID  world)
static

Initialize threading structures (only used in ODE 0.13 and newer).

Notice that this will create a worker thread for each world.

Parameters
world[in] the world id.

◆ isSupported()

static bool isSupported ( )
static

Check if threading is supported.

The function will return false for ODE 0.13 and newer if ODE is compiled without the –enable-builtin-threading-impl option.

Returns
true if supported, false otherwise.
See also
assertSupported

The documentation for this class was generated from the following file: