HomePhabricator

Add RWCollection, a read-write locked collection with a mostly safe API

Description

Add RWCollection, a read-write locked collection with a mostly safe API

Summary:
The codebase is badly lacking a read-write collection utility that promotes proper use through its API.

RWCollection cannot be manipulated directly, but through views that also hold a lock. It is possible to have several read views at once, but the collection can only be read from using them. It is possible to only hold one write view at once, and the collection can be modified using it.

Test Plan:

make check

Added unit tests for the new code.

Reviewers: #bitcoin_abc, schancel

Reviewed By: #bitcoin_abc, schancel

Subscribers: schancel, Fabien, teamcity

Differential Revision: https://reviews.bitcoinabc.org/D2005

Details

Provenance
deadalnixAuthored on Nov 4 2018, 13:33
jasonbcoxPushed on Nov 7 2018, 17:49
Reviewer
Restricted Project
Differential Revision
D2005: Add RWCollection, a read-write locked collection with a mostly safe API
Parents
rSTAGINGa46dd46abc1c: Update relase checklist
Branches
Unknown
Tags
Unknown