Page MenuHomePhabricator

[RCU] Add new features to RCUPtr
ClosedPublic

Authored by deadalnix on Jan 20 2019, 17:54.

Details

Summary
  • Make constructor private and add factory methods to clear up ownership.
  • Add a release method for the RCUPtr to give up ownership.
  • Add get method to get the underlying pointer.
  • Add operator* overloads.
  • Add an explicit convertion to bool that checks for null
Test Plan

Added tests cases that uses all these methods.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
betterrcuptr
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4749
Build 7561: Bitcoin ABC Buildbot (legacy)
Build 7560: arc lint + arc unit

Event Timeline

jasonbcox requested changes to this revision.Jan 24 2019, 20:53
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/rcu.h
78 ↗(On Diff #6760)

nit: stylistically, I think private: should be added at the top of this class and the others in this file.

95 ↗(On Diff #6760)

acquire(nullptr) needs test case

112 ↗(On Diff #6760)

copy(nullptr) needs test case

This revision now requires changes to proceed.Jan 24 2019, 20:53
deadalnix added inline comments.
src/test/rcu_tests.cpp
206 ↗(On Diff #6760)

What is that ?

Dunno how I missed it.

This revision is now accepted and ready to land.Jan 25 2019, 22:35

Use the NULLPTR macro to work around a bug in boost.

This revision was automatically updated to reflect the committed changes.