Thread Utility Manual
The Cinema 4D classic API provides various functions to handle threads and thread related tasks.
Various tasks should only be performed from the main thread. For example any GUI interaction or any change of the currently active BaseDocument must only happen from the main thread. To make sure that such code is only executed in the main thread the following functions can be used:
// check if the external renderer ("Picture Viewer") is running if ( CheckIsRunning ( CHECKISRUNNING::EXTERNALRENDERING )) { GeStopBackgroundThreads ( BACKGROUNDHANDLER_TYPECLASS_C4D , BACKGROUNDHANDLERFLAGS::RENDEREXTERNAL , nullptr ); }
These functions are used to obtain certain threads:
// execute the loop until the escThread signals to stop while (!escThread-> TestBreak ()) { DoSomething(); }