From 72d9811956dd5b206c98cfa21dd99b37d6cd9dd5 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 29 Aug 2006 21:02:25 +0000 Subject: [PATCH] ICU-5352 Fix thread safety issue on Itanium, which is a weak memory model CPU. X-SVN-Rev: 20182 --- icu4c/source/common/unicode/pwin32.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h index 00c814380f6..669f55a6ec8 100644 --- a/icu4c/source/common/unicode/pwin32.h +++ b/icu4c/source/common/unicode/pwin32.h @@ -172,8 +172,10 @@ typedef unsigned int uint32_t; /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ #define ICU_USE_THREADS 1 -/* Windows currently only runs on x86 CPUs which currently all have strong memory models. */ +/* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check mutex lock. */ +#if defined(_M_IX86) || defined(_M_AMD64) || (defined(__GNUC__) && (defined(__i386__) || defined(__amd64__))) #define UMTX_STRONG_MEMORY_MODEL 1 +#endif #ifndef U_DEBUG #ifdef _DEBUG