Use ptr-to-const in Futex
[folly.git] / folly / test / DeterministicSchedule.cpp
index 87ecb762b7524d9547b07729e09c4bfc7ce309c9..d4e8d2da7f63d149cdea059f2d3d579a8fed4293 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2013-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -277,8 +277,8 @@ void DeterministicSchedule::wait(sem_t* sem) {
     // we're not busy waiting because this is a deterministic schedule
   }
 }
-}
-}
+} // namespace test
+} // namespace folly
 
 namespace folly {
 namespace detail {
@@ -289,8 +289,8 @@ using namespace std::chrono;
 template <>
 FutexResult Futex<DeterministicAtomic>::futexWaitImpl(
     uint32_t expected,
-    time_point<system_clock>* absSystemTimeout,
-    time_point<steady_clock>* absSteadyTimeout,
+    system_clock::time_point const* absSystemTimeout,
+    steady_clock::time_point const* absSteadyTimeout,
     uint32_t waitMask) {
   bool hasTimeout = absSystemTimeout != nullptr || absSteadyTimeout != nullptr;
   bool awoken = false;
@@ -382,6 +382,7 @@ int Futex<DeterministicAtomic>::futexWake(int count, uint32_t wakeMask) {
   DeterministicSchedule::afterSharedAccess();
   return rv;
 }
+} // namespace detail
 
 template <>
 CacheLocality const& CacheLocality::system<test::DeterministicAtomic>() {
@@ -391,7 +392,6 @@ CacheLocality const& CacheLocality::system<test::DeterministicAtomic>() {
 
 template <>
 Getcpu::Func AccessSpreader<test::DeterministicAtomic>::pickGetcpuFunc() {
-  return &DeterministicSchedule::getcpu;
-}
-}
+  return &detail::DeterministicSchedule::getcpu;
 }
+} // namespace folly