Readonly
currentGet 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.
Readonly
mainGet the main thread.
Readonly
mainReturn the EventTarget for the main thread.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
This queues a runnable to the main thread. It's a shortcut for JS callers to be used instead of .mainThread.dispatch(runnable, Ci.nsIEventTarget.DISPATCH_NORMAL); or .currentThread.dispatch(runnable, Ci.nsIEventTarget.DISPATCH_NORMAL); C++ callers should instead use NS_DispatchToMainThread.
This queues a runnable to the main thread's idle queue.
The event to dispatch.
The time in milliseconds until this event should be moved from the idle queue to the regular queue if it hasn't been executed by then. If not passed or a zero value is specified, the event will never be moved to the regular queue.
Create a new thread (a global, user PRThread) with the specified name.
The newly created nsIThread object.
The name of the thread. If it is empty the thread will not be named.
Configuration options for the newly created thread.
Enter a nested event loop on the current thread, waiting on, and processing events until condition.isDone() returns true.
If condition.isDone() throws, this function will throw as well.
C++ code should not use this function, instead preferring mozilla::SpinEventLoopUntil.
Similar to the previous method, but the spinning of the event loop terminates when the quit application shutting down starts.
C++ code should not use this function, instead preferring mozilla::SpinEventLoopUntil.
Generated using TypeDoc
An interface for creating and locating nsIThread instances.