зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1671577 - Use OtherPid() in AddProfilerMarker(). r=jld
Aside from its use in AddProfilerMarker(), after initialization mPeerPid is only used on the IO thread, so the write to it does not hold the monitor. This means that the read in AddProfilerMarker() can cause a race, even though we hold the monitor. This method is only called when we hold the monitor and everything is set up, so I think we can just use mListener->OtherPid() to get the PID. Differential Revision: https://phabricator.services.mozilla.com/D93810
This commit is contained in:
Родитель
3fc0c60d52
Коммит
1425ce2012
|
@ -2784,10 +2784,10 @@ void MessageChannel::DumpInterruptStack(const char* const pfx) const {
|
|||
|
||||
void MessageChannel::AddProfilerMarker(const IPC::Message& aMessage,
|
||||
MessageDirection aDirection) {
|
||||
mMonitor->AssertCurrentThreadOwns();
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_feature_active(ProfilerFeature::IPCMessages)) {
|
||||
// If mPeerPid is -1, messages are being sent to the current process.
|
||||
int32_t pid = mPeerPid == -1 ? base::GetCurrentProcId() : mPeerPid;
|
||||
int32_t pid = mListener->OtherPid();
|
||||
PROFILER_ADD_MARKER_WITH_PAYLOAD(
|
||||
"IPC", IPC, IPCMarkerPayload,
|
||||
(pid, aMessage.seqno(), aMessage.type(), mSide, aDirection,
|
||||
|
|
Загрузка…
Ссылка в новой задаче