The multithreaded API for benchmarks provides that teardown can happen in
thread 0. For this to be safe, all other threads executing the benchmark
function need to have exited. Otherwise, thread 0 may begin to teardown shared
resources before the other threads have stopped using these resources as they
are in their last loop of while (KeepRunning()) { ... }.
This change creates a single exit point for KeepRunning() to return false.
When running a multithreaded benchmark, thread 0 blocks on KeepRunning() until
all other threads have exited. This approach allows for there to be no change
to the user-facing API exemplified in the BM_MultiThreaded example.
There is a unused parameter at benchmark:866 Benchmark::MeasurePeakHeapMemory .
The function is marked as TODO and the code that uses the parameter is commented out.
I just removed the parameter so it can compile again without editing the CMake compile flags.
Currently there are tests for ARMV3 and ARMV6 in cycleclock.h which are not
defined using gcc on ARM. Since there is also a cast to the unknown type
int64 I assume that the ARM code has not been tested. Therefore this patch
replaces the checks for ARMV3 and ARMV6 by checks for __ARM_ARCH. Also, the
cast to int64 is fixed by casting to int64_t.
Benchmark library builds and runs but only single-threaded. Multithreaded
support needs a bit more love.
Currently requires some C++11 support (g++ 4.6.3 seems to work).