Bug 1572235: Expose a method to remove markers leftover from previous runs of the profiler. r=gerald

Differential Revision: https://phabricator.services.mozilla.com//D41275

--HG--
extra : histedit_source : c73fed719d5e5e607ede15bbbf74ed5554083b21
This commit is contained in:
Will Hawkins 2019-08-09 21:04:57 +03:00
parent d5c11f21a0
commit 3050e35cce
2 changed files with 12 additions and 0 deletions

View File

@ -133,6 +133,16 @@ class ProfilerSignalSafeLinkedList {
abort();
}
reset();
}
// Reset the list of pending signals in this list.
// We assume that this is called at a time when it is
// guaranteed that no more than a single user (the caller)
// is accessing the list. In particular, it is only
// called from within the RacyRegisteredThread::ReinitializeOnResume
// method.
void reset() {
while (mList.peek()) {
delete mList.popHead();
}

View File

@ -59,6 +59,8 @@ class RacyRegisteredThread final {
// This is called on every profiler restart. Put things that should happen at
// that time here.
void ReinitializeOnResume() {
mPendingMarkers.reset();
// This is needed to cause an initial sample to be taken from sleeping
// threads that had been observed prior to the profiler stopping and
// restarting. Otherwise sleeping threads would not have any samples to