From fdbcede38d1226b6dcfcf7dbebaecffcb0e962d5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 14 Jun 2014 11:18:26 +0200 Subject: Make KSharedConfig thread-safe ... by having a different list of shareable objects per thread. REVIEW: 118739 --- src/core/ksharedconfig.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/ksharedconfig.h') diff --git a/src/core/ksharedconfig.h b/src/core/ksharedconfig.h index 03f05b08..b2317afd 100644 --- a/src/core/ksharedconfig.h +++ b/src/core/ksharedconfig.h @@ -30,12 +30,16 @@ * * KConfig variant using shared memory * - * KSharedConfig provides a reference counted, shared memory variant + * KSharedConfig provides a shared (reference counted) variant * of KConfig. This allows you to use manipulate the same configuration * files from different places in your code without worrying about * accidentally overwriting changes. * - * Note that, as with most of kdelibs, this is @b NOT threadsafe. + * The openConfig() method is threadsafe: every thread gets a separate repository + * of shared KConfig objects. This means, however, that you'll be responsible for + * synchronizing the instances of KConfig for the same filename between threads, + * using reparseConfiguration after a manual change notification, just like you have + * to do between processes. */ class KCONFIGCORE_EXPORT KSharedConfig : public KConfig, public QSharedData //krazy:exclude=dpointer (only for refcounting) { -- cgit v1.2.1