Commit 140a17aa authored by Maged Michael's avatar Maged Michael Committed by Facebook Github Bot

CoreCachedSharedPtr: Use synchronization/hazptr instead of experimental/hazptr

Summary: Use synchronization/hazptr instead of experimental/hazptr

Reviewed By: djwatson

Differential Revision: D7565384

fbshipit-source-id: 26790eec80f344cb4b227672e6d51d97c9170dee
parent cf18e2d4
......@@ -22,7 +22,7 @@
#include <folly/concurrency/AtomicSharedPtr.h>
#include <folly/concurrency/CacheLocality.h>
#include <folly/container/Enumerate.h>
#include <folly/experimental/hazptr/hazptr.h>
#include <folly/synchronization/Hazptr.h>
namespace folly {
......@@ -130,8 +130,8 @@ class AtomicCoreCachedSharedPtr {
}
std::shared_ptr<T> get() const {
folly::hazptr::hazptr_holder hazptr;
auto slots = hazptr.get_protected(slots_);
folly::hazptr_local<1> hazptr;
auto slots = hazptr[0].get_protected(slots_);
if (!slots) {
return nullptr;
}
......@@ -140,7 +140,7 @@ class AtomicCoreCachedSharedPtr {
private:
using Holder = std::shared_ptr<T>;
struct Slots : folly::hazptr::hazptr_obj_base<Slots> {
struct Slots : folly::hazptr_obj_base<Slots> {
std::array<std::shared_ptr<T>, kNumSlots> slots_;
};
std::atomic<Slots*> slots_{nullptr};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment