Page MenuHomePhabricator

[RCU] Add facility to register cleanup actions to be run when other thread catch up
ClosedPublic

Authored by deadalnix on Jan 15 2019, 18:04.

Details

Summary

In order to avoid the need for synchronization every time a cleanup action is required, it is preferable to register the cleanups and run the cleanup all at once when synchronization is requested.

Test Plan

Added test cases to check cleanups are running as expected.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
rcucleanup
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4533
Build 7129: Bitcoin ABC Buildbot (legacy)
Build 7128: arc lint + arc unit

Event Timeline

  • Make sure hasSyncedTo return a reasonable upper bound.
  • Simplify the synchronized loop.
Fabien requested changes to this revision.Jan 21 2019, 17:42
Fabien added a subscriber: Fabien.

One nit in comment, looks good otherwise

src/rcu.cpp
208

fromthe => from the

This revision now requires changes to proceed.Jan 21 2019, 17:42
This revision is now accepted and ready to land.Jan 21 2019, 19:15
This revision was automatically updated to reflect the committed changes.