Struct xpcom::interfaces::nsIThreadInternal [] [src]

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

interface nsIThreadInternal : nsIThread

/**
 * The XPCOM thread object implements this interface, which allows a consumer
 * to observe dispatch activity on the thread.
 */

Methods

impl nsIThreadInternal
[src]

[src]

Cast this nsIThreadInternal to one of its base interfaces.

impl nsIThreadInternal
[src]

[src]

/**
   * Get/set the current thread observer (may be null).  This attribute may be
   * read from any thread, but must only be set on the thread corresponding to
   * this thread object.  The observer will be released on the thread
   * corresponding to this thread object after all other events have been
   * processed during a call to Shutdown.
   */

attribute nsIThreadObserver observer;

[src]

/**
   * Get/set the current thread observer (may be null).  This attribute may be
   * read from any thread, but must only be set on the thread corresponding to
   * this thread object.  The observer will be released on the thread
   * corresponding to this thread object after all other events have been
   * processed during a call to Shutdown.
   */

attribute nsIThreadObserver observer;

[src]

/**
   * Add an observer that will *only* receive onProcessNextEvent,
   * beforeProcessNextEvent. and afterProcessNextEvent callbacks. Always called
   * on the target thread, and the implementation does not have to be
   * threadsafe. Order of callbacks is not guaranteed (i.e.
   * afterProcessNextEvent may be called first depending on whether or not the
   * observer is added in a nested loop). Holds a strong ref.
   */

void addObserver (in nsIThreadObserver observer);

[src]

/**
   * Remove an observer added via the addObserver call. Once removed the
   * observer will never be called again by the thread.
   */

void removeObserver (in nsIThreadObserver observer);

Methods from Deref<Target = nsIThread>

[src]

Cast this nsIThread to one of its base interfaces.

[src]

/**
   * @returns
   *  Whether or not this thread may call into JS. Used in the profiler
   *  to avoid some unnecessary locking.
   */

[noscript] attribute boolean CanInvokeJS;

[src]

/**
   * @returns
   *  Whether or not this thread may call into JS. Used in the profiler
   *  to avoid some unnecessary locking.
   */

[noscript] attribute boolean CanInvokeJS;

[src]

/**
   * Shutdown the thread.  This method prevents further dispatch of events to
   * the thread, and it causes any pending events to run to completion before
   * the thread joins (see PR_JoinThread) with the current thread.  During this
   * method call, events for the current thread may be processed.
   *
   * This method MAY NOT be executed from the thread itself.  Instead, it is
   * meant to be executed from another thread (usually the thread that created
   * this thread or the main application thread).  When this function returns,
   * the thread will be shutdown, and it will no longer be possible to dispatch
   * events to the thread.
   *
   * @throws NS_ERROR_UNEXPECTED
   *   Indicates that this method was erroneously called when this thread was
   *   the current thread, that this thread was not created with a call to
   *   nsIThreadManager::NewThread, or if this method was called more than once
   *   on the thread object.
   */

void shutdown ();

[src]

/**
   * This method may be called to determine if there are any events ready to be
   * processed.  It may only be called when this thread is the current thread.
   *
   * Because events may be added to this thread by another thread, a "false"
   * result does not mean that this thread has no pending events.  It only
   * means that there were no pending events when this method was called.
   *
   * @returns
   *   A boolean value that if "true" indicates that this thread has one or
   *   more pending events.
   *
   * @throws NS_ERROR_UNEXPECTED
   *   Indicates that this method was erroneously called when this thread was
   *   not the current thread.
   */

boolean hasPendingEvents ();

[src]

/**
   * Process the next event.  If there are no pending events, then this method
   * may wait -- depending on the value of the mayWait parameter -- until an
   * event is dispatched to this thread.  This method is re-entrant but may
   * only be called if this thread is the current thread.
   *
   * @param mayWait
   *   A boolean parameter that if "true" indicates that the method may block
   *   the calling thread to wait for a pending event.
   *
   * @returns
   *   A boolean value that if "true" indicates that an event was processed.
   *
   * @throws NS_ERROR_UNEXPECTED
   *   Indicates that this method was erroneously called when this thread was
   *   not the current thread.
   */

boolean processNextEvent (in boolean mayWait);

[src]

/**
   * Shutdown the thread asynchronously.  This method immediately prevents
   * further dispatch of events to the thread, and it causes any pending events
   * to run to completion before this thread joins with the current thread.
   *
   * UNLIKE shutdown() this does not process events on the current thread.
   * Instead it merely ensures that the current thread continues running until
   * this thread has shut down.
   *
   * This method MAY NOT be executed from the thread itself.  Instead, it is
   * meant to be executed from another thread (usually the thread that created
   * this thread or the main application thread).  When this function returns,
   * the thread will continue running until it exhausts its event queue.
   *
   * @throws NS_ERROR_UNEXPECTED
   *   Indicates that this method was erroneously called when this thread was
   *   the current thread, that this thread was not created with a call to
   *   nsIThreadManager::NewThread, or if this method was called more than once
   *   on the thread object.
   */

void asyncShutdown ();

[src]

/**
   * Use this attribute to dispatch runnables to the thread. Eventually, the
   * eventTarget attribute will be the only way to dispatch events to a
   * thread--nsIThread will no longer inherit from nsIEventTarget.
   */

readonly attribute nsIEventTarget eventTarget;

Trait Implementations

impl XpCom for nsIThreadInternal
[src]

IID: nsIID = nsID(2745642591, 29145, 19165, [143, 48, 89, 167, 143, 182, 213, 235])

[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 nsIThreadInternal
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIThreadInternal
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.