Review Request 118985: KSharedConfig: only write to mainConfig and wasTestModeEnabled in the main thread

David Faure faure at kde.org
Sun Jun 29 13:32:04 UTC 2014



> On June 29, 2014, 3:31 a.m., Matthew Dawson wrote:
> > src/core/ksharedconfig.cpp, line 83
> > <https://git.reviewboard.kde.org/r/118985/diff/1/?file=285018#file285018line83>
> >
> >     Thinking more on this, both ways are incorrect.  This should instead be based on a per thread variable, as the list needs to be cleared in all threads if this is the case.  I think the easy way to handle this is to move wasTestModeEnabled into GlobalSharedConfigList.

(!@#!@ reviewboard lost this comment the fist time I typed it. ARGL.)


Unit tests are expected to switch QStandardPaths to test mode on startup.
I don't see the point in supporting very weird use cases like "let's create threads, use KSharedConfig everywhere, and then switch QStandardPaths to test mode".


> On June 29, 2014, 3:31 a.m., Matthew Dawson wrote:
> > src/core/ksharedconfig.cpp, line 107
> > <https://git.reviewboard.kde.org/r/118985/diff/1/?file=285018#file285018line107>
> >
> >     As this seems to be mainly an optimization to ensure the config is not unnecessarily deleted, I think it makes sense to still run this on alternate threads.

Interesting point, I'll implement that.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118985/#review61157
-----------------------------------------------------------


On June 27, 2014, 10:31 p.m., David Faure wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118985/
> -----------------------------------------------------------
> 
> (Updated June 27, 2014, 10:31 p.m.)
> 
> 
> Review request for KDE Frameworks and Matthew Dawson.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> KSharedConfig: only write to mainConfig and wasTestModeEnabled in the main thread
> 
> As a side effect, this removes the need for the atomic ints, since
> that code now only runs in the main thread.
> 
> 
> Diffs
> -----
> 
>   src/core/ksharedconfig.cpp b7d155d5893502921d35d7dd971188b6a93a0620 
> 
> Diff: https://git.reviewboard.kde.org/r/118985/diff/
> 
> 
> Testing
> -------
> 
> no regression in "make test" in kconfig; still debugging races in helgrind threadtest (in kio).
> 
> 
> Thanks,
> 
> David Faure
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140629/bcc309ff/attachment.html>


More information about the Kde-frameworks-devel mailing list