Index: source/test/intltest/tzfmttst.cpp |
diff --git a/source/test/intltest/tzfmttst.cpp b/source/test/intltest/tzfmttst.cpp |
index c3a03317cc40b4957e909358b1fdc76bdf706dd0..8a7735afe81367fe1b159ba6d0d892605fbdd399 100644 |
--- a/source/test/intltest/tzfmttst.cpp |
+++ b/source/test/intltest/tzfmttst.cpp |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************* |
-* Copyright (C) 2007-2014, International Business Machines Corporation and * |
+* Copyright (C) 2007-2015, International Business Machines Corporation and * |
* others. All Rights Reserved. * |
******************************************************************************* |
*/ |
@@ -678,11 +678,7 @@ TimeZoneFormatTest::TestTimeRoundTrip(void) { |
data.END_TIME = END_TIME; |
data.numDone = 0; |
-#if (ICU_USE_THREADS==0) |
- TestTimeRoundTripThread fakeThread(*this, data, 0); |
- fakeThread.run(); |
-#else |
- TestTimeRoundTripThread **threads = new TestTimeRoundTripThread*[threadCount]; |
+ TestTimeRoundTripThread **threads = new TestTimeRoundTripThread*[nThreads]; |
int32_t i; |
for (i = 0; i < nThreads; i++) { |
threads[i] = new TestTimeRoundTripThread(*this, data, i); |
@@ -691,16 +687,11 @@ TimeZoneFormatTest::TestTimeRoundTrip(void) { |
} |
} |
- UBool done = false; |
- while (true) { |
- umtx_lock(NULL); |
- if (data.numDone == nLocales) { |
- done = true; |
- } |
- umtx_unlock(NULL); |
- if (done) |
- break; |
- SimpleThread::sleep(1000); |
+ for (i = 0; i < nThreads; i++) { |
+ threads[i]->join(); |
+ } |
+ if (data.numDone != nLocales) { |
+ errln("%s:%d data.numDone = %d, nLocales = %d", __FILE__, __LINE__, data.numDone, nLocales); |
} |
for (i = 0; i < nThreads; i++) { |
@@ -708,7 +699,6 @@ TimeZoneFormatTest::TestTimeRoundTrip(void) { |
} |
delete [] threads; |
-#endif |
UDate total = 0; |
logln("### Elapsed time by patterns ###"); |
for (int32_t i = 0; i < NUM_PATTERNS; i++) { |
@@ -960,7 +950,7 @@ TimeZoneFormatTest::TestISOFormat(void) { |
// Formatting |
UErrorCode status = U_ZERO_ERROR; |
- LocalPointer<SimpleDateFormat> sdf(new SimpleDateFormat(status)); |
+ LocalPointer<SimpleDateFormat> sdf(new SimpleDateFormat(status), status); |
if (U_FAILURE(status)) { |
dataerrln("Fail new SimpleDateFormat: %s", u_errorName(status)); |
return; |