nsIThreadManager

An interface for creating and locating nsIThread instances.

Methods

newThread(creationFlags, stackSize)

Create a new thread (a global, user PRThread).

Parameters

creationFlags Reserved for future use. Pass 0.
stackSize Number of bytes to reserve for the thread's stack.

Returns

The newly created nsIThread object.

getThreadFromPRThread(prthread)

Get the nsIThread object (if any) corresponding to the given PRThread.
This method returns null if there is no corresponding nsIThread.

Parameters

prthread The PRThread of the nsIThread being requested.

Returns

The nsIThread object corresponding to the given PRThread or null if no such nsIThread exists.

Attributes

mainThread

Get the main thread.

currentThread

Get the current thread. If the calling thread does not already have a
nsIThread associated with it, then a new nsIThread will be created and
associated with the current PRThread.

isMainThread

This attribute is true if the calling thread is the main thread of the
application process.

Constants

DEFAULT_STACK_SIZE

Default number of bytes reserved for a thread’s stack, if no stack size
is specified in newThread(). 0 means use platform default.