Bug 1726594 - Add some documentation about the purpose of VsyncIOThread. r=mstange
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 19 Aug 2021 16:35:32 +0000
changeset 589337 a585bac19cdfeb56c7c06a19a1cc6eccc6c7abb9
parent 589336 57c5259febbde85293185d2e55c23b59eaf4f4ac
child 589338 d425eea582f43b97ed484ce0e3e350a51becc7e1
push id38719
push userccozmuta@mozilla.com
push dateThu, 19 Aug 2021 21:49:42 +0000
treeherdermozilla-central@d425eea582f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1726594
milestone93.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 1726594 - Add some documentation about the purpose of VsyncIOThread. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D123136
gfx/ipc/VsyncIOThreadHolder.cpp
--- a/gfx/ipc/VsyncIOThreadHolder.cpp
+++ b/gfx/ipc/VsyncIOThreadHolder.cpp
@@ -28,16 +28,23 @@ VsyncIOThreadHolder::~VsyncIOThreadHolde
     SchedulerGroup::Dispatch(
         TaskCategory::Other,
         NewRunnableMethod("nsIThread::AsyncShutdown", mThread,
                           &nsIThread::AsyncShutdown));
   }
 }
 
 bool VsyncIOThreadHolder::Start() {
+  /* "VsyncIOThread" is used as the thread we send/recv IPC messages on.  We
+   * don't use the "WindowsVsyncThread" directly because it isn't servicing an
+   * nsThread event loop which is needed for IPC to return results/notify us
+   * about shutdown etc.
+   *
+   * It would be better if we could notify the IPC IO thread directly to avoid
+   * the extra ping-ponging but that doesn't seem possible. */
   nsresult rv = NS_NewNamedThread("VsyncIOThread", getter_AddRefs(mThread));
   return NS_SUCCEEDED(rv);
 }
 
 RefPtr<nsIThread> VsyncIOThreadHolder::GetThread() const { return mThread; }
 
 }  // namespace gfx
 }  // namespace mozilla