Files
palemoon27/xpcom/threads/nsIThreadPool.idl
T
roytam1 14c77e53f5 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1161590 - Ignore blocklist preference in nightly and aurora. r=jrmuizelaar (47ec8bee6)
- Bug 1162299 - Distinguish between all features and unrecognized feature. r=kats (e9705844f)
- Add compositor, layers, and rendering info to nsIGfxInfo. (bug 1179051 part 5, r=mattwoodrow) (b4e6da05f)
- Bug 1186002. Avoid testing for recreate on broken drivers. r=dvander (10506f4f2)
- Bug 1156407 - part 1 - use static_assert instead of PR_STATIC_ASSERT; r=mccr8 (ff53e05ba)
- Bug 1156407 - part 2 - make CALLBACK_TYPE enum a private implementation detail of nsTimerImpl; r=mccr8 (de0cc6527)
- Bug 1156407 - part 3 - get rid of NS_NewTimer; r=mccr8 (c598b96e0)
- Bug 1095433: fix the race condition in the Task Tracer that crashes processes forked from Nuwa. r=tlee (cffe07827)
- Bug 1113562 - Expected delay time of tasks should not be the latency of those kind. r=sinker (f422ae04e)
- Bug 1155059: Patch 1&2 - Convert Dispatch() and friends to already_AddRefed<> r=froydnj (2ca9850af)
- Bug 1155059: Patch 4 - invoke NS_ASSERTION if DispatchToMainThread fails to get MainThread ptr r=froydnj (651903c22)
- Bug 1155059: Patch 3&7 - fix leaks in Promise, ConsoleService and JS Finalize r=froydnj (b57cb08d9)
- Bug 1155059: Patch 5 - clean up ServiceWorkers and avoid leaks r=nikhil (666245af8)
- Bug 1155059: Patch 6 - fix problems with gfxFontInfoLoader shutdown sequence r=jdaggett (332e8bd76)
- Bug 1155059: Patch 8 - Don't leak runnables when MediaCache/FileBlockCache get shut down after XPCOM is in final shutdown r=cpearce (18f36fa25)
- Bug 1155059: Patch 9 - Modify DataChannel.cpp to use updated API r=froydnj (c5415703c)
- Bug 1176446 - TextureClientD3D11 should take into account the layer backend when allocating a surface. r=bas (3c1b59296)
- Bug 1176363 - Part 1: Stop using DrawTargets off the main thread. r=mattwoodrow (624e8107a)
- Bug 1176363 - Part 2: Allow mapping of SourceSurfaceRawData from multiple threads. r=bas (38c8363cf)
- Fix d3d11 texture sharing checks being preserved across device resets. (bug 1183910 part 6, r=mattwoodrow) (658121c50)
- Clear the blur cache after device resets. (bug 1188032, r=bas) (c362b2ec6)
2021-06-17 09:58:49 +08:00

89 lines
3.2 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIEventTarget.idl"
[scriptable, uuid(ef194cab-3f86-4b61-b132-e5e96a79e5d1)]
interface nsIThreadPoolListener : nsISupports
{
/**
* Called when a new thread is created by the thread pool. The notification
* happens on the newly-created thread.
*/
void onThreadCreated();
/**
* Called when a thread is about to be destroyed by the thread pool. The
* notification happens on the thread that is about to be destroyed.
*/
void onThreadShuttingDown();
};
/**
* An interface to a thread pool. A thread pool creates a limited number of
* anonymous (unnamed) worker threads. An event dispatched to the thread pool
* will be run on the next available worker thread.
*/
[scriptable, uuid(cacd4a2e-2655-4ff8-894c-10c15883cd0a)]
interface nsIThreadPool : nsIEventTarget
{
/**
* Shutdown the thread pool. This method may not be executed from any thread
* in the thread pool. Instead, it is meant to be executed from another
* thread (usually the thread that created this thread pool). When this
* function returns, the thread pool and all of its threads will be shutdown,
* and it will no longer be possible to dispatch tasks to the thread pool.
*
* As a side effect, events on the current thread will be processed.
*/
void shutdown();
/**
* Get/set the maximum number of threads allowed at one time in this pool.
*/
attribute unsigned long threadLimit;
/**
* Get/set the maximum number of idle threads kept alive.
*/
attribute unsigned long idleThreadLimit;
/**
* Get/set the amount of time in milliseconds before an idle thread is
* destroyed.
*/
attribute unsigned long idleThreadTimeout;
/**
* Get/set the number of bytes reserved for the stack of all threads in
* the pool. By default this is nsIThreadManager::DEFAULT_STACK_SIZE.
*/
attribute unsigned long threadStackSize;
/**
* An optional listener that will be notified when a thread is created or
* destroyed in the course of the thread pool's operation.
*
* A listener will only receive notifications about threads created after the
* listener is set so it is recommended that the consumer set the listener
* before dispatching the first event. A listener that receives an
* onThreadCreated() notification is guaranteed to always receive the
* corresponding onThreadShuttingDown() notification.
*
* The thread pool takes ownership of the listener and releases it when the
* shutdown() method is called. Threads created after the listener is set will
* also take ownership of the listener so that the listener will be kept alive
* long enough to receive the guaranteed onThreadShuttingDown() notification.
*/
attribute nsIThreadPoolListener listener;
/**
* Set the label for threads in the pool. All threads will be named
* "<aName> #<n>", where <n> is a serial number.
*/
void setName(in ACString aName);
};