/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#ifndef FOLLY_DETAIL_MEMORYIDLER_H
-#define FOLLY_DETAIL_MEMORYIDLER_H
+#pragma once
#include <atomic>
#include <chrono>
#include <folly/Hash.h>
#include <folly/Traits.h>
#include <folly/detail/Futex.h>
+#include <folly/portability/PThread.h>
namespace folly {
// multiplying the duration by a floating point doesn't work, grr..
auto extraFrac =
timeoutVariationFrac / std::numeric_limits<uint64_t>::max() * h;
- uint64_t tics = idleTimeout.count() * (1 + extraFrac);
+ auto tics = uint64_t(idleTimeout.count() * (1 + extraFrac));
idleTimeout = typename Clock::duration(tics);
}
};
}} // namespace folly::detail
-
-#endif