1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 22:40:33 +08:00

Fixed linking and threading analyzer issues.

This commit is contained in:
Olaf Krzikalla 2023-10-09 09:58:55 +02:00
parent b027d02284
commit afa85ecb97
3 changed files with 5 additions and 4 deletions

View File

@ -994,7 +994,7 @@ class BENCHMARK_EXPORT State {
};
// ThreadState can be used in a manually multithreaded benchmark loop.
class ThreadState : public State {
class BENCHMARK_EXPORT ThreadState : public State {
public:
explicit ThreadState(State& s);
~ThreadState();

View File

@ -121,7 +121,7 @@ void BenchmarkInstance::Teardown() const {
}
void MergeResults(const State& st, const ThreadTimer* timer,
ThreadManager* manager) {
ThreadManager* manager) NO_THREAD_SAFETY_ANALYSIS {
ThreadManager::Result& results = manager->results;
results.iterations += st.iterations();
results.cpu_time_used += timer->cpu_time_used();

View File

@ -10,6 +10,7 @@
#include "benchmark/benchmark.h"
#include "commandlineflags.h"
#include "mutex.h"
namespace benchmark {
namespace internal {
@ -83,8 +84,8 @@ bool FindBenchmarksInternal(const std::string& re,
bool IsZero(double n);
void MergeResults(const State& st, const ThreadTimer* timer,
ThreadManager* manager);
void MergeResults(const State& st, const ThreadTimer* timer, // only call while holding benchmark_mutex_
ThreadManager* manager) NO_THREAD_SAFETY_ANALYSIS;
BENCHMARK_EXPORT
ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false);