X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c585ccef9cc010d0557a17998f3d5a4c286de537..c9d13e86a698164843715665624ccb929e37255c:/tests/benchmarks/tls.cpp?ds=sidebyside diff --git a/tests/benchmarks/tls.cpp b/tests/benchmarks/tls.cpp index 213d3e87df..de6a4c2737 100644 --- a/tests/benchmarks/tls.cpp +++ b/tests/benchmarks/tls.cpp @@ -10,6 +10,8 @@ #include "bench.h" +#include "wx/tls.h" + #if defined(__UNIX__) #define HAVE_PTHREAD #include @@ -28,7 +30,7 @@ // uncomment this to also test Boost version (you will also need to link with // libboost_threads) -#define HAVE_BOOST_THREAD +//#define HAVE_BOOST_THREAD #ifdef HAVE_BOOST_THREAD #include #endif @@ -171,3 +173,18 @@ BENCHMARK_FUNC(BoostTLS) } #endif // HAVE_BOOST_THREAD + +BENCHMARK_FUNC(wxTLS) +{ + static wxTLS_TYPE(int) s_global; + + for ( int n = 0; n < NUM_ITER; n++ ) + { + if ( n % 2 ) + s_global = 0; + else + s_global = n; + } + + return !s_global; +}