summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 931fbb4..1660e95 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -43,6 +43,7 @@
#include <QLocale>
#include <QTime>
#include <QVariant>
+#include <QThread>
#include <e32std.h>
#include "private/qcore_symbian_p.h"
@@ -773,8 +774,8 @@ static QLocale::MeasurementSystem symbianMeasurementSystem()
QLocale QSystemLocale::fallbackLocale() const
{
// load system data before query calls
- static bool initDone = false;
- if (!initDone) {
+ static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0);
+ if (initDone.testAndSetRelaxed(0, 1)) {
_s60Locale.LoadSystemSettings();
// Initialize platform version dependent function pointers
@@ -794,7 +795,12 @@ QLocale QSystemLocale::fallbackLocale() const
ptrGetLongDateFormatSpec = &defaultFormatSpec;
if (!ptrGetShortDateFormatSpec)
ptrGetShortDateFormatSpec = &defaultFormatSpec;
+ bool ret = initDone.testAndSetRelease(1, 2);
+ Q_ASSERT(ret);
+ Q_UNUSED(ret);
}
+ while(initDone != 2)
+ QThread::yieldCurrentThread();
TLanguage lang = User::Language();
QString locale = QLatin1String(qt_symbianLocaleName(lang));