[Development] Question about QCoreApplicationData::*_libpaths
Иван Комиссаров
abbapoh at gmail.com
Fri Jan 22 09:43:17 CET 2016
Why? In case of QMap, we have no need to use operator= to change the map.
We simply detach and insert new data in it.
Of course, in case of multiple changes, the map can reach some "invalid
state" before changes are finished (i.e. in case we need transacted
changes, we have to use mutex anyway). But it is not neccessary in some
cases.
2016-01-22 12:48 GMT+03:00 Marc Mutz <marc.mutz at kdab.com>:
> On Friday 22 January 2016 01:31:20 Kevin Kofler wrote:
> > Marc Mutz wrote:
> > > Ivan was talking about thread-safe classes. You need to lock a mutex to
> > > take the copy.
> >
> > Returning a QMap instead of a std::shared_ptr<std::map> would be
> perfectly
> > thread-safe there.
>
> Wrong.
>
> --
> Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
> KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
> Tel: +49-30-521325470
> KDAB - The Qt Experts
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160122/58d8f6df/attachment.html>
More information about the Development
mailing list