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]
pub fn coerce<T: nsIThreadManagerCoerce>(&self) -> &T
[src]
Cast this nsIThreadManager
to one of its base interfaces.
impl nsIThreadManager
[src]
pub const DEFAULT_STACK_SIZE: i64
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.
*/
pub unsafe fn NewThread(
&self,
creationFlags: uint32_t,
stackSize: uint32_t,
_retval: *mut *const nsIThread
) -> nsresult
[src]
&self,
creationFlags: uint32_t,
stackSize: uint32_t,
_retval: *mut *const nsIThread
) -> nsresult
/**
* 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);
pub unsafe fn NewNamedThread(
&self,
name: &nsACString,
stackSize: uint32_t,
_retval: *mut *const nsIThread
) -> nsresult
[src]
&self,
name: &nsACString,
stackSize: uint32_t,
_retval: *mut *const nsIThread
) -> nsresult
/**
* 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);
pub unsafe fn GetMainThread(
&self,
aMainThread: *mut *const nsIThread
) -> nsresult
[src]
&self,
aMainThread: *mut *const nsIThread
) -> nsresult
/**
* Get the main thread.
*/
readonly attribute nsIThread mainThread;
pub unsafe fn GetCurrentThread(
&self,
aCurrentThread: *mut *const nsIThread
) -> nsresult
[src]
&self,
aCurrentThread: *mut *const nsIThread
) -> nsresult
/**
* 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;
pub unsafe fn DispatchToMainThread(
&self,
event: *const nsIRunnable,
priority: uint32_t
) -> nsresult
[src]
&self,
event: *const nsIRunnable,
priority: uint32_t
) -> nsresult
/**
* 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);
pub unsafe fn IdleDispatchToMainThread(
&self,
event: *const nsIRunnable,
timeout: uint32_t
) -> nsresult
[src]
&self,
event: *const nsIRunnable,
timeout: uint32_t
) -> nsresult
/**
* 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);
pub unsafe fn SpinEventLoopUntil(
&self,
condition: *const nsINestedEventLoopCondition
) -> nsresult
[src]
&self,
condition: *const nsINestedEventLoopCondition
) -> nsresult
/**
* 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);
pub unsafe fn SpinEventLoopUntilEmpty(&self) -> nsresult
[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 ();
pub unsafe fn GetSystemGroupEventTarget(
&self,
aSystemGroupEventTarget: *mut *const nsIEventTarget
) -> nsresult
[src]
&self,
aSystemGroupEventTarget: *mut *const nsIEventTarget
) -> nsresult
/**
* Return the SchedulerEventTarget for the SystemGroup.
*/
readonly attribute nsIEventTarget systemGroupEventTarget;
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIThreadManager
[src]
const IID: nsIID
IID: nsIID = nsID(468229834, 58103, 17723, [141, 56, 193, 27, 162, 71, 246, 243])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIThreadManager
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.