12658_thread-1.cc, [...]: Use __gnu_test::try_named_locale.

2004-07-14  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/22_locale/locale/cons/12658_thread-1.cc, 12658_thread-2.cc:
	Use __gnu_test::try_named_locale.

From-SVN: r84687
This commit is contained in:
Paolo Carlini 2004-07-14 14:01:45 +00:00 committed by Paolo Carlini
parent 39cab01994
commit 8063a3559d
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-07-14 Paolo Carlini <pcarlini@suse.de>
* testsuite/22_locale/locale/cons/12658_thread-1.cc,
12658_thread-2.cc: Use __gnu_test::try_named_locale.
2004-07-13 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/ext/mt_allocator.html: Add docs for _Tune.

View File

@ -26,6 +26,7 @@
#include <locale>
#include <pthread.h>
#include <testsuite_hooks.h>
const int max_thread_count = 20;
//const int max_loop_count = 1000000; // orig value
@ -39,7 +40,7 @@ void* thread_main(void*)
std::locale loc_c = std::locale::classic();
std::locale loc[max_locales];
for (int j = 0; j < max_locales; ++j)
loc[j] = std::locale(j % 2 ? "en_US" : "fr_FR");
loc[j] = __gnu_test::try_named_locale(j % 2 ? "en_US" : "fr_FR");
for (int i = 0; i < max_loop_count; ++i)
{

View File

@ -24,6 +24,7 @@
#include <locale>
#include <pthread.h>
#include <testsuite_hooks.h>
const int max_thread_count = 20;
//const int max_loop_count = 1000000; // orig value
@ -51,7 +52,7 @@ main()
pthread_t tid[max_thread_count];
for (int j = 0; j < max_locales; ++j)
loc[j] = std::locale(j % 2 ? "en_US" : "fr_FR");
loc[j] = __gnu_test::try_named_locale(j % 2 ? "en_US" : "fr_FR");
for (int i = 0; i < max_thread_count; i++)
pthread_create(&tid[i], NULL, thread_main, 0);