- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions

# MThreadAsync Class Reference
OpenMaya - API module for common classes

This reference page is linked to from the following overview topics: Threading and Maya, API Classes and plug-ins, Threading and Maya API.

Search for all occurrences

## Detailed Description

Methods for creating threads.

MThreadAsync class. Allows creation of asynchronous threads.

`#include <MThreadAsync.h>`

List of all members.

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

## Member Function Documentation

MStatus init | ( |  | ) | `[static]`

Search for all occurrences

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:
  threadTestWithLocksCmd.cpp.

MStatus createTask | ( | MThreadFunc | func,
|  | void * | data,
|  | MThreadAsyncCallbackFunc | afunc,
|  | MThreadRootTask * | root
| ) |  | `[static]`

Search for all occurrences

Create a single task.

createMapping must have been called before calling this method.

Parameters:

  [in] | func | pointer to function to be executed by threads
  [in] | data | data for function
  [in] | afunc | pointer to callback function to be executed by threads
  [in] | root | root task

Returns:
  - MS::kSuccess The method was successful.
  - MS::kFailure Thread does not exist, call createMapping first

Examples:
  threadTestWithLocksCmd.cpp.

void release | ( |  | ) | `[static]`

Search for all occurrences

This function decreases the reference count on the class.

When the reference count reaches zero the threads are deleted.

Examples:
  threadTestWithLocksCmd.cpp.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync
MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync MThreadAsync