class MThreadAsync

Jump to documentation

Methods for creating threads. (OpenMaya)

public members:

static MStatus init ()
static MStatus createTask (MThreadFunc func, void* data, MThreadAsyncCallbackFunc afunc, MThreadRootTask* root)
static void release ()

Documentation

Methods for creating threads. (OpenMaya)
Description

MThreadAsync class. Allows creation of asynchronous threads.

Functions

MStatus MThreadAsync:: init ()

Description

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.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory Insufficient memory to complete this method

MStatus MThreadAsync:: createTask (MThreadFunc func, void* data, MThreadAsyncCallbackFunc afunc, MThreadRootTask* root)

Description

Create a single task. createMapping must have been called before calling this method.

Arguments

  • func pointer to function to be executed by threads
  • data data for function
  • afunc pointer to callback function to be executed by threads
  • root root task

Return Value

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

void MThreadAsync:: release ()

Description

This function decreases the reference count on the class. When the reference count reaches zero the threads are deleted.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright