Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_thread_factory Class Reference
[Concurrency]

A class to launch threads in a platform-portable manner. More...

#include <xmog_thread_factory.h>

List of all members.

Static Public Member Functions

static int spawn (XMOG_THREAD_FUNC func, void *arg=NULL)
 Starts a new thread.
static int spawn_n (size_t count, XMOG_THREAD_FUNC func, void *arg=NULL)
 Starts a number of new threads.
static void wait_n (int grp_id)
 Waits for completion of all threads started by an invocation of spawn_n().


Detailed Description

A class to launch threads in a platform-portable manner.

This class is intended to support platform-portable thread-related testcases for the runtime library.


Member Function Documentation

static int xmog_thread_factory::spawn XMOG_THREAD_FUNC  func,
void *  arg = NULL
[static]
 

Starts a new thread.

Parameters:
func the thread function.
arg the argument for the threadfunction.
Returns:
0 on success, other number on failure.

static int xmog_thread_factory::spawn_n size_t  count,
XMOG_THREAD_FUNC  func,
void *  arg = NULL
[static]
 

Starts a number of new threads.

Parameters:
count the number of new threads to start.
func the thread function.
arg the argument for the threadfunction.
Returns:
-1 on failure, the group id of the launched threads otherwise. The group id can be used to wait for completion using the wait_n() function.

static void xmog_thread_factory::wait_n int  grp_id  )  [static]
 

Waits for completion of all threads started by an invocation of spawn_n().

Parameters:
grp_id the value returned by an invocation of spwan_n().


The documentation for this class was generated from the following file:
Generated on Wed May 31 14:01:35 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1