Bug 1688937 - Remove now-unused thread counting r=KrisWright

Depends on D103190

Differential Revision: https://phabricator.services.mozilla.com/D103191
This commit is contained in:
Chris H-C 2021-02-01 18:25:27 +00:00
Родитель 41cd32c04d
Коммит b98fffa595
4 изменённых файлов: 0 добавлений и 28 удалений

Просмотреть файл

@ -114,9 +114,6 @@ NS_DECL_CI_INTERFACE_GETTER(nsThread)
Array<char, nsThread::kRunnableNameBufSize> nsThread::sMainThreadRunnableName;
uint32_t nsThread::sActiveThreads;
uint32_t nsThread::sMaxActiveThreads;
#ifdef EARLY_BETA_OR_EARLIER
const uint32_t kTelemetryWakeupCountLimit = 100;
#endif
@ -335,26 +332,16 @@ void nsThread::ClearThreadList() {
/* static */
nsThreadEnumerator nsThread::Enumerate() { return {}; }
/* static */
uint32_t nsThread::MaxActiveThreads() {
OffTheBooksMutexAutoLock mal(ThreadListMutex());
return sMaxActiveThreads;
}
void nsThread::AddToThreadList() {
OffTheBooksMutexAutoLock mal(ThreadListMutex());
MOZ_ASSERT(!isInList());
sActiveThreads++;
sMaxActiveThreads = std::max(sActiveThreads, sMaxActiveThreads);
ThreadList().insertBack(this);
}
void nsThread::MaybeRemoveFromThreadList() {
OffTheBooksMutexAutoLock mal(ThreadListMutex());
if (isInList()) {
sActiveThreads--;
removeFrom(ThreadList());
}
}

Просмотреть файл

@ -238,8 +238,6 @@ class nsThread : public nsIThreadInternal,
static nsThreadEnumerator Enumerate();
static uint32_t MaxActiveThreads();
// When entering local execution mode a new event queue is created and used as
// an event source. This queue is only accessible through an
// nsLocalExecutionGuard constructed from the nsLocalExecutionRecord returned
@ -288,11 +286,6 @@ class nsThread : public nsIThreadInternal,
static mozilla::LinkedList<nsThread>& ThreadList();
static void ClearThreadList();
// The current number of active threads.
static uint32_t sActiveThreads;
// The maximum current number of active threads we've had in this session.
static uint32_t sMaxActiveThreads;
void AddToThreadList();
void MaybeRemoveFromThreadList();

Просмотреть файл

@ -768,10 +768,6 @@ nsThreadManager::GetMainThreadEventTarget(nsIEventTarget** aTarget) {
return NS_OK;
}
uint32_t nsThreadManager::GetHighestNumberOfThreads() {
return nsThread::MaxActiveThreads();
}
NS_IMETHODIMP
nsThreadManager::DispatchToMainThread(nsIRunnable* aEvent, uint32_t aPriority,
uint8_t aArgc) {

Просмотреть файл

@ -68,10 +68,6 @@ class nsThreadManager : public nsIThreadManager {
already_AddRefed<nsISerialEventTarget> CreateBackgroundTaskQueue(
const char* aName);
// Returns the maximal number of threads that have been in existence
// simultaneously during the execution of the thread manager.
uint32_t GetHighestNumberOfThreads();
~nsThreadManager();
void EnableMainThreadEventPrioritization();