[Differential] [Commented On] D3392: winutils_p.h: Restore compatibility with WinXP SDK

kfunk (Kevin Funk) noreply at phabricator.kde.org
Wed Nov 16 23:42:44 UTC 2016


kfunk added a comment.


  In https://phabricator.kde.org/D3392#63341, @brauch wrote:
  
  > Hm, there is at least one race condition here: thread A does old = ::SetErrorMode(...), then if before it resets it thread B does the same, then the old mode might never be restored. We can put a mutex but of course there might be another piece of code which does the same. So *shrug* not sure what to do, I guess it's just bad API and that's why MS replaced it.
  
  
  I really just wouldn't care about it. We likely never ever run in that scenario.
  
  Keep in mind, that Qt uses `Get/SetErrorMode` like this since ages:
  https://code.woboq.org/qt5/qtbase/src/corelib/io/qfsfileengine_unix.cpp.html#_ZN13QFSFileEngine6drivesEv (here and in other places). It's essentially the same code; not protected by a mutex or anything.
  
  > Maybe on XP we should just set the flag once on startup? At least that's not racy.

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: kfunk, #frameworks, brauch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20161116/045ce5d8/attachment.html>


More information about the Kde-frameworks-devel mailing list