Bug 1463893 - make nsThreadStartupEvent's destructor private; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Thu, 24 May 2018 16:44:37 -0400
changeset 473968 8239a2ac64c54fae1bd2b573d1e7218d1f37fc87
parent 473967 24cfa380890604a502afaa388bee7e6587407fd2
child 473969 f38805d4a3898e56052231f6a14a785094205270
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1463893
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1463893 - make nsThreadStartupEvent's destructor private; r=erahm Whatever compiler bugs required this destructor to be public have either long since been fixed, or the compilers themselves have become obsolete. Plus we get to fix a wrong comment and make another class final in the process.
xpcom/threads/nsThread.cpp
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -192,17 +192,17 @@ NS_INTERFACE_MAP_BEGIN(nsThread)
     foundInterface = static_cast<nsIClassInfo*>(&sThreadClassInfo);
   } else
 NS_INTERFACE_MAP_END
 NS_IMPL_CI_INTERFACE_GETTER(nsThread, nsIThread, nsIThreadInternal,
                             nsIEventTarget, nsISupportsPriority)
 
 //-----------------------------------------------------------------------------
 
-class nsThreadStartupEvent : public Runnable
+class nsThreadStartupEvent final : public Runnable
 {
 public:
   nsThreadStartupEvent()
     : Runnable("nsThreadStartupEvent")
     , mMon("nsThreadStartupEvent.mMon")
     , mInitialized(false)
   {
   }
@@ -212,21 +212,19 @@ public:
   void Wait()
   {
     ReentrantMonitorAutoEnter mon(mMon);
     while (!mInitialized) {
       mon.Wait();
     }
   }
 
-  // This method needs to be public to support older compilers (xlC_r on AIX).
-  // It should be called directly as this class type is reference counted.
-  virtual ~nsThreadStartupEvent() {}
+private:
+  ~nsThreadStartupEvent() = default;
 
-private:
   NS_IMETHOD Run() override
   {
     ReentrantMonitorAutoEnter mon(mMon);
     mInitialized = true;
     mon.Notify();
     return NS_OK;
   }