D27126: [SNI] Fix race condition in item registration

David Edmundson noreply at phabricator.kde.org
Mon Feb 3 13:46:27 GMT 2020


davidedmundson added a comment.


  Well identified, it is racey.
  
  But the solution seems off
  
  on line 68 we check
  on line 75 we implicitly check again
  now we're checking a 3rd time!
  
  I think we can instead solve it with some re-arranging
  
     m_serviceWatcher->addWatchedService(service);
     if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value())  {
      // as before except for the moved line
    } else {
      m_serviceWatcher->removeWatchedService(service);
    }

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D27126

To: kmaterka, #plasma_workspaces, #plasma
Cc: davidedmundson, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200203/11780893/attachment-0001.html>


More information about the Plasma-devel mailing list