3ds Max C++ API Reference
MaxSDK::ThreadingDebuggingTools Namespace Reference

The functions in this namespace are provided to assist in debugging operations performed on a worker thread. More...

Classes

class  WorkerThreadSet
 A class to help control the setting of the worker thread. More...
 

Functions

UtilExport bool IsInMainThread ()
 Returns true if in main thread. More...
 
UtilExport void SetWorkerThread (DWORD threadID=(DWORD) -1)
 Sets the worker thread id to use for testing in IsExclusivelyInMainOrWorkerThread function. More...
 
UtilExport DWORD GetWorkerThread ()
 Returns the worker thread id set via SetWorkerThread. More...
 
UtilExport void ClearWorkerThread ()
 Clears the worker thread id value. More...
 
UtilExport bool IsExclusivelyInMainOrWorkerThread ()
 Returns true if (a) the worker thread id is not set and in main thread, or (b) the worker thread id is set and in that thread. More...
 
UtilExport void Disable ()
 Disables checking. More...
 

Detailed Description

The functions in this namespace are provided to assist in debugging operations performed on a worker thread.

Many operations in 3ds Max should normally always be performed in the main thread. This includes operations such as creating or deleting Animatable-derived objects and Hold system operations. In some controlled cases, these operations can be performed in worker threads, but in these cases these operations can only be performed in a single worker thread. For example, an importer may display a modal dialog with a progress bar in the main thread and perform the import in a worker thread.

Function Documentation

◆ IsInMainThread()

UtilExport bool MaxSDK::ThreadingDebuggingTools::IsInMainThread ( )

Returns true if in main thread.

◆ SetWorkerThread()

UtilExport void MaxSDK::ThreadingDebuggingTools::SetWorkerThread ( DWORD  threadID = (DWORD) -1)

Sets the worker thread id to use for testing in IsExclusivelyInMainOrWorkerThread function.

Parameters
threadID- The worker thread id. If a threadID value of -1 is used, the worker thread id is set to the current thread id

◆ GetWorkerThread()

UtilExport DWORD MaxSDK::ThreadingDebuggingTools::GetWorkerThread ( )

Returns the worker thread id set via SetWorkerThread.

If no worker thread is set, the returned value is 0.

◆ ClearWorkerThread()

UtilExport void MaxSDK::ThreadingDebuggingTools::ClearWorkerThread ( )

Clears the worker thread id value.

◆ IsExclusivelyInMainOrWorkerThread()

UtilExport bool MaxSDK::ThreadingDebuggingTools::IsExclusivelyInMainOrWorkerThread ( )

Returns true if (a) the worker thread id is not set and in main thread, or (b) the worker thread id is set and in that thread.

◆ Disable()

UtilExport void MaxSDK::ThreadingDebuggingTools::Disable ( )

Disables checking.