C++ API Reference
MThreadAsync Class Reference

Methods for creating threads. More...

#include <MThreadAsync.h>

Static Public Member Functions

static MStatus init ()
 Initialize asynchronous thread creation mechanism. More...
 
static MStatus createTask (MThreadFunc func, void *data, MThreadAsyncCallbackFunc afunc, MThreadRootTask *root)
 Create a single task. More...
 
static void release ()
 This function decreases the reference count on the class. More...
 
static const char * className ()
 Returns the name of this class. More...
 

Detailed Description

Methods for creating threads.

MThreadAsync class. Allows creation of asynchronous threads.

Member Function Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MStatus init ( )
static

Initialize asynchronous thread creation mechanism.

No threads are created by this call. Each call to init increases a reference count on the class, each call to release() reduces the reference count. When the reference count reaches zero the threads are deleted.

Returns
  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory Insufficient memory to complete this method
Examples:
autoLoader/threadData.cpp, and threadTestWithLocksCmd/threadTestWithLocksCmd.cpp.
MStatus createTask ( MThreadFunc  func,
void *  data,
MThreadAsyncCallbackFunc  afunc,
MThreadRootTask *  root 
)
static

Create a single task.

createMapping must have been called before calling this method.

Parameters
[in]funcpointer to function to be executed by threads
[in]datadata for function
[in]afuncpointer to callback function to be executed by threads
[in]rootroot task
Returns
  • MS::kSuccess The method was successful.
  • MS::kFailure Thread does not exist, call createMapping first
Examples:
autoLoader/threadData.cpp, and threadTestWithLocksCmd/threadTestWithLocksCmd.cpp.
void release ( )
static

This function decreases the reference count on the class.

When the reference count reaches zero the threads are deleted.

Examples:
autoLoader/threadData.cpp, and threadTestWithLocksCmd/threadTestWithLocksCmd.cpp.
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.

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