From 7ecc972c39b5637ed7d317abbd3a2b5823759dfa Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 18 Dec 2007 01:31:11 +0000 Subject: [PATCH] ICU-6076 Prevent a double mutex lock when the following happens. ucol_open -> u_cleanup -> ures_open same locale. Notice that the collator leaked, which contained open resource bundles. The resource bundle API didn't recover very well from this experience, and a double mutex lock happens, which is hard to debug in the test framework. This change will make it easier to test the -m option, reduce open resources while a collator is running and make it easier to segment the collator for static libraries. X-SVN-Rev: 23107 --- icu4c/source/test/intltest/apicoll.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/icu4c/source/test/intltest/apicoll.cpp b/icu4c/source/test/intltest/apicoll.cpp index 0150f1a919..bd8e444674 100644 --- a/icu4c/source/test/intltest/apicoll.cpp +++ b/icu4c/source/test/intltest/apicoll.cpp @@ -1956,7 +1956,7 @@ public: uint8_t*result, int32_t resultLength) const; virtual UnicodeSet *getTailoredSet(UErrorCode &status) const; virtual UBool operator!=(const Collator& other) const; - virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale); + virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale); TestCollator() : Collator() {}; TestCollator(UCollationStrength collationStrength, UNormalizationMode decompositionMode) : Collator(collationStrength, decompositionMode) {}; @@ -2155,9 +2155,9 @@ UnicodeSet * TestCollator::getTailoredSet(UErrorCode &status) const return Collator::getTailoredSet(status); } -void TestCollator::setLocales(const Locale& requestedLocale, const Locale& validLocale) +void TestCollator::setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale) { - Collator::setLocales(requestedLocale, validLocale); + Collator::setLocales(requestedLocale, validLocale, actualLocale); } @@ -2196,7 +2196,7 @@ void CollationAPITest::TestSubclass() // use base class implementation Locale loc1 = Locale::getGermany(); Locale loc2 = Locale::getFrance(); - col1.setLocales(loc1, loc2); // default implementation has no effect + col1.setLocales(loc1, loc2, loc2); // default implementation has no effect UnicodeString displayName; col1.getDisplayName(loc1, loc2, displayName); // de_DE collator in fr_FR locale