notification queue read -> readNoInt
[folly.git] / folly / futures / Future.cpp
index 78f33d2608426dcb8b7ed31463d38852ef6f94ea..7cc623e3fc414898fc69d0057c44b4d89836a33e 100644 (file)
  * limitations under the License.
  */
 #include <folly/futures/Future.h>
-#include <folly/futures/detail/ThreadWheelTimekeeper.h>
+#include <folly/futures/ThreadWheelTimekeeper.h>
 #include <folly/Likely.h>
 
 namespace folly {
 
 // Instantiate the most common Future types to save compile time
-template class Future<void>;
+template class Future<Unit>;
 template class Future<bool>;
 template class Future<int>;
 template class Future<int64_t>;
@@ -31,27 +31,13 @@ template class Future<double>;
 
 namespace folly { namespace futures {
 
-Future<void> sleep(Duration dur, Timekeeper* tk) {
+Future<Unit> sleep(Duration dur, Timekeeper* tk) {
+  std::shared_ptr<Timekeeper> tks;
   if (LIKELY(!tk)) {
-    tk = detail::getTimekeeperSingleton();
+    tks = folly::detail::getTimekeeperSingleton();
+    tk = DCHECK_NOTNULL(tks.get());
   }
   return tk->after(dur);
 }
 
 }}
-
-namespace folly { namespace detail {
-
-template <>
-CollectContext<void>::~CollectContext() {
-  if (!threw.exchange(true)) {
-    p.setValue();
-  }
-}
-
-template <>
-void CollectContext<void>::setPartialResult(size_t i, Try<void>& t) {
-  // Nothing to do for void
-}
-
-}}