Struct xpcom::interfaces::nsIThreadManager [] [src]

#[repr(C)]
pub struct nsIThreadManager { /* fields omitted */ }

interface nsIThreadManager : nsISupports

/**
 * An interface for creating and locating nsIThread instances.
 */

Methods

impl nsIThreadManager
[src]

[src]

Cast this nsIThreadManager to one of its base interfaces.

impl nsIThreadManager
[src]

DEFAULT_STACK_SIZE: i64 = 0
/**
   * Default number of bytes reserved for a thread's stack, if no stack size
   * is specified in newThread(). 0 means use platform default.
   */

[src]

/**
   * Create a new thread (a global, user PRThread).
   *
   * @param creationFlags
   *   Reserved for future use.  Pass 0.
   * @param stackSize
   *   Number of bytes to reserve for the thread's stack.
   *
   * @returns
   *   The newly created nsIThread object.
   */

nsIThread newThread (in unsigned long creationFlags, [optional] in unsigned long stackSize);

[src]

/**
   * Create a new thread (a global, user PRThread) with the specified name.
   *
   * @param name
   *   The name of the thread. Passing an empty name is equivalent to
   *   calling newThread(0, stackSize), i.e. the thread will not be named.
   * @param stackSize
   *   Number of bytes to reserve for the thread's stack.
   *
   * @returns
   *   The newly created nsIThread object.
   */

[noscript] nsIThread newNamedThread (in ACString name, [optional] in unsigned long stackSize);

[src]

/**
   * Get the main thread.
   */

readonly attribute nsIThread mainThread;

[src]

/**
   * 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.
   */

readonly attribute nsIThread currentThread;

[src]

/**
   * 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.
   */

void dispatchToMainThread (in nsIRunnable event, [optional] in uint32_t priority);

[src]

/**
   * This queues a runnable to the main thread's idle queue.
   *
   * @param event
   *   The event to dispatch.
   * @param timeout
   *   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.
   */

void idleDispatchToMainThread (in nsIRunnable event, [optional] in uint32_t timeout);

[src]

/**
   * 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.
   */

void spinEventLoopUntil (in nsINestedEventLoopCondition condition);

[src]

/**
   * Spin the current thread's event loop until there are no more pending
   * events.  This could be done with spinEventLoopUntil, but that would
   * require access to the current thread from JavaScript, which we are
   * moving away from.
   */

void spinEventLoopUntilEmpty ();

[src]

/**
   * Return the SchedulerEventTarget for the SystemGroup.
   */

readonly attribute nsIEventTarget systemGroupEventTarget;

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIThreadManager
[src]

IID: nsIID = nsID(468229834, 58103, 17723, [141, 56, 193, 27, 162, 71, 246, 243])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIThreadManager
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIThreadManager
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.