Update hazard pointers prototype
authorMaged Michael <magedmichael@fb.com>
Mon, 10 Oct 2016 13:43:52 +0000 (06:43 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Mon, 10 Oct 2016 13:53:34 +0000 (06:53 -0700)
commit328c1a56226af7219787981940d9f9b05faf4aea
tree5d0c617ff25c9250e5e6cb033b582e859bdf8c7d
parenta62c9841120eb374f8b933d31444a590acee6123
Update hazard pointers prototype

Summary:
Interface:
- Got rid of std::function reclamation functions and added a Deleter template parameter.
- Got rid of the flush() member functions of hazptr_domain
- Added a lock-free non-bool member function to get a protected pointer.
Implementation:
- Implemented the interface changes.
- Changed the order of accesses in reading the shared list of objects vs reading the hazard pointers. I think the previous order would have allowed recently protected objects to be reclaimed incorrectly.
Updated the examples and tests accordingly.

Reviewed By: davidtgoldblatt

Differential Revision: D3981284

fbshipit-source-id: 35ff60da3aea1f67c58d82437dda58f6d8b07bf5
folly/experimental/hazptr/example/LockFreeLIFO.h
folly/experimental/hazptr/example/SWMRList.h
folly/experimental/hazptr/example/WideCAS.h
folly/experimental/hazptr/hazptr-impl.h
folly/experimental/hazptr/hazptr.h
folly/experimental/hazptr/test/HazptrTest.cpp
folly/experimental/hazptr/test/HazptrUse1.h
folly/experimental/hazptr/test/HazptrUse2.h