272
edits
m (→nsRunnable) |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 199: | Line 199: | ||
* Create a new thread. | * Create a new thread. | ||
* | * | ||
* @param | * @param result | ||
* The | * The resulting nsIThread object. | ||
* @param event | * @param event | ||
* The initial event to run on this thread. This can be null. | * The initial event to run on this thread. This can be null. | ||
*/ | */ | ||
NS_METHOD NS_NewThread( | NS_METHOD NS_NewThread(nsIThread **result, nsIRunnable *event); | ||
| | ||
/** | /** | ||
| Line 225: | Line 221: | ||
*/ | */ | ||
NS_METHOD NS_GetMainThread(nsIThread **result); | NS_METHOD NS_GetMainThread(nsIThread **result); | ||
| | ||
/** | /** | ||
| Line 288: | Line 274: | ||
| | ||
already_AddRefed<nsIThread> do_GetMainThread(); | already_AddRefed<nsIThread> do_GetMainThread(); | ||
=== nsRunnable === | === nsRunnable === | ||
| Line 308: | Line 292: | ||
Dispatching <code>MyEvent</code> is then as simple as: | Dispatching <code>MyEvent</code> is then as simple as: | ||
nsCOMPtr<nsIRunnable> event = new MyEvent(); | nsCOMPtr<nsIRunnable> event = new MyEvent(); | ||
rv = NS_DispatchToCurrentThread(event); | |||
NS_ENSURE_SUCCESS(rv, rv); | |||
== From JS == | == From JS == | ||
edits