diff --git a/shared_ptr_mt_test.cpp b/shared_ptr_mt_test.cpp index 831be86..489aa7c 100644 --- a/shared_ptr_mt_test.cpp +++ b/shared_ptr_mt_test.cpp @@ -84,7 +84,7 @@ char const * title = "Using POSIX threads"; #include -extern "C" void* common_thread_routine(void * pv) +extern "C" void * common_thread_routine(void * pv) { abstract_thread * pt = static_cast(pv); pt->run(); @@ -145,9 +145,17 @@ void test(boost::shared_ptr 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 pi(new int(42)); @@ -167,7 +175,7 @@ int test_main( int, char ** ) t = std::clock() - t; - std::printf("%.4f seconds.\n", static_cast(t) / CLOCKS_PER_SEC); + std::printf("\n\n%.3f seconds.\n", static_cast(t) / CLOCKS_PER_SEC); return 0; }