/*
- * Copyright 2017-present Facebook, Inc.
+ * Copyright 2014-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.
~Baton() {}
+ bool ready() const {
+ auto state = waitingFiber_.load();
+ return state == POSTED;
+ }
+
/**
* Puts active fiber to sleep. Returns when post is called.
*/
union {
std::atomic<intptr_t> waitingFiber_;
struct {
- folly::detail::Futex<> futex;
+ folly::detail::Futex<> futex{};
int32_t _unused_packing;
} futex_;
};