diff options
Diffstat (limited to 'staging_vespalib/src/tests')
-rw-r--r-- | staging_vespalib/src/tests/clock/clock_benchmark.cpp | 5 | ||||
-rw-r--r-- | staging_vespalib/src/tests/clock/clock_test.cpp | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/staging_vespalib/src/tests/clock/clock_benchmark.cpp b/staging_vespalib/src/tests/clock/clock_benchmark.cpp index c5229adea31..a9618d50682 100644 --- a/staging_vespalib/src/tests/clock/clock_benchmark.cpp +++ b/staging_vespalib/src/tests/clock/clock_benchmark.cpp @@ -1,10 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/util/clock.h> +#include <vespa/fastos/thread.h> #include <cassert> #include <vector> #include <atomic> #include <cstring> +#include <condition_variable> +#include <mutex> using vespalib::Clock; using fastos::TimeStamp; @@ -134,7 +137,7 @@ main(int , char *argv[]) TestClock nsClock(nsValue, 1.0/frequency); TestClock nsVolatileClock(nsVolatile, 1.0/frequency); TestClock nsAtomicClock(nsAtomic, 1.0/frequency); - assert(pool.NewThread(&clock, nullptr) != nullptr); + assert(pool.NewThread(clock.getRunnable(), nullptr) != nullptr); assert(pool.NewThread(&nsClock, nullptr) != nullptr); assert(pool.NewThread(&nsVolatileClock, nullptr) != nullptr); assert(pool.NewThread(&nsAtomicClock, nullptr) != nullptr); diff --git a/staging_vespalib/src/tests/clock/clock_test.cpp b/staging_vespalib/src/tests/clock/clock_test.cpp index c8c93272e85..bf7e3773055 100644 --- a/staging_vespalib/src/tests/clock/clock_test.cpp +++ b/staging_vespalib/src/tests/clock/clock_test.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/clock.h> +#include <vespa/fastos/thread.h> using vespalib::Clock; using fastos::TimeStamp; @@ -20,7 +21,7 @@ Test::Main() Clock clock(0.050); FastOS_ThreadPool pool(0x10000); - ASSERT_TRUE(pool.NewThread(&clock, nullptr) != nullptr); + ASSERT_TRUE(pool.NewThread(clock.getRunnable(), nullptr) != nullptr); fastos::SteadyTimeStamp start = clock.getTimeNS(); FastOS_Thread::Sleep(5000); fastos::SteadyTimeStamp stop = clock.getTimeNS(); |