Small modifications.

[SVN r13212]
This commit is contained in:
Peter Dimov
2002-03-15 22:03:56 +00:00
parent b89945d36a
commit fb5b1a20d2

View File

@ -84,7 +84,7 @@ char const * title = "Using POSIX threads";
#include <pthread.h>
extern "C" void* common_thread_routine(void * pv)
extern "C" void * common_thread_routine(void * pv)
{
abstract_thread * pt = static_cast<abstract_thread *>(pv);
pt->run();
@ -145,9 +145,17 @@ void test(boost::shared_ptr<int> const & pi)
int const m = 16; // threads
#if defined(BOOST_LWM_USE_CRITICAL_SECTION)
char const * implementation = "critical section";
#elif defined(BOOST_LWM_USE_PTHREADS)
char const * implementation = "pthread_mutex";
#else
char const * implementation = "spinlock";
#endif
int test_main( int, char ** )
{
std::printf("%s: %d threads, %d iterations, ", title, m, n);
std::printf("%s: %s, %d threads, %d iterations: ", title, implementation, m, n);
boost::shared_ptr<int> pi(new int(42));
@ -167,7 +175,7 @@ int test_main( int, char ** )
t = std::clock() - t;
std::printf("%.4f seconds.\n", static_cast<double>(t) / CLOCKS_PER_SEC);
std::printf("\n\n%.3f seconds.\n", static_cast<double>(t) / CLOCKS_PER_SEC);
return 0;
}