Open Bug 1875116 Opened 10 months ago Updated 10 months ago

Release locks sooner in TimerThread/TimerThreadWrapper

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

People

(Reporter: jlink, Unassigned)

References

Details

It has been noted in bug 1873170 that it is possible to trigger a deadlock in TimerThreadWrapper (TTW) when the profiler is enabled.

Part of this is due to TTW enforcing a stronger-than-needed mutex condition and part of this is/would be due to TimerThread (TT) holding its own lock a bit longer than it needs to.
The work here would be to:

  1. Switch TTW to use a locking mechanism that merely blocks TTW::Init()/Shutdown() from executing concurrently with other TTW methods but allows other TTW methods to be executed at the same time. One way to accomplish this would be with a mutex and a counter.
  2. Make TT release its locks slightly earlier, at least in TT::AddTimer() and TT:RemoveTimer(). Specifically, it doesn't need to hold its locks while the profiler-specific branch is being checked/executed.
Summary: Release locks sooner in TimerThread/TimerThreadWrapped → Release locks sooner in TimerThread/TimerThreadWrapper
You need to log in before you can comment on or make changes to this bug.