diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 12:04:45 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 12:04:45 +0200 |
commit | 64809ac8367bb4c059f55a8595f47a323237b238 (patch) | |
tree | 62af23907c274c398b231340c006a76700c8f90c /staging_vespalib | |
parent | 7bbbf406f3cd920222aba9039c6a460370a4ab14 (diff) |
Remove more clutter in fastos/types.h
Diffstat (limited to 'staging_vespalib')
4 files changed, 16 insertions, 10 deletions
diff --git a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp b/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp index 1331c070612..d222a26c496 100644 --- a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp +++ b/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp @@ -4,6 +4,8 @@ #include <vespa/vespalib/util/optimized.h> #include <vespa/vespalib/util/allocinarray.h> #include <vespa/vespalib/util/array.hpp> +#include <csignal> + #include <vespa/log/log.h> LOG_SETUP("allocinarray_benchmark"); diff --git a/staging_vespalib/src/tests/array/sort_benchmark.cpp b/staging_vespalib/src/tests/array/sort_benchmark.cpp index f3650273644..a7629084094 100644 --- a/staging_vespalib/src/tests/array/sort_benchmark.cpp +++ b/staging_vespalib/src/tests/array/sort_benchmark.cpp @@ -2,6 +2,8 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/rusage.h> #include <vespa/vespalib/util/array.hpp> +#include <csignal> + #include <vespa/log/log.h> LOG_SETUP("sort_benchmark"); diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp index b8fd84f812e..5d8ec190d59 100644 --- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp @@ -1,12 +1,23 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "shutdownguard.h" #include <unistd.h> +#include <sys/time.h> #include <vespa/log/log.h> LOG_SETUP(".vespalib.shutdownguard"); namespace vespalib { +namespace { +enum { STACK_SIZE = (1u << 16) }; + +static uint64_t getTimeInMillis() { + struct timeval mytime; + gettimeofday(&mytime, 0); + uint64_t mult = 1000; + return (mytime.tv_sec * mult) + (mytime.tv_usec / mult); +} +} void ShutdownGuard::Run(FastOS_ThreadInterface *, void *) { while (_dieAtTime > getTimeInMillis()) { @@ -32,5 +43,4 @@ ShutdownGuard::~ShutdownGuard() _pool.Close(); } - } diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h index 2eeb06e1a03..5a9aad5d4d4 100644 --- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h +++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h @@ -2,6 +2,7 @@ #pragma once #include <vespa/fastos/thread.h> +#include <cstdint> namespace vespalib { @@ -14,15 +15,6 @@ namespace vespalib { **/ class ShutdownGuard : public FastOS_Runnable { - enum { STACK_SIZE = (1u << 16) }; - - static uint64_t getTimeInMillis() { - struct timeval mytime; - gettimeofday(&mytime, 0); - uint64_t mult = 1000; - return (mytime.tv_sec * mult) + (mytime.tv_usec / mult); - } - FastOS_ThreadPool _pool; volatile uint64_t _dieAtTime; |