Page MenuHomePhabricator

[avalanche] Create an event loop facility.
ClosedPublic

Authored by deadalnix on Nov 11 2018, 14:22.

Details

Summary

Avalanche will need to pool peers on a regular basis, which require an event loop. This introduces the event loop, but it does nothing so far.

Depends on D2042

Test Plan
make check

Added unit tests.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avaeventloop
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4059
Build 6189: Bitcoin ABC Buildbot (legacy)
Build 6188: arc lint + arc unit

Event Timeline

deadalnix changed the visibility from "Public (No Login Required)" to "Restricted Project (Project)".Nov 11 2018, 14:22
deadalnix edited the summary of this revision. (Show Details)
jasonbcox requested changes to this revision.Nov 11 2018, 23:20
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/avalanche.cpp
61 ↗(On Diff #5750)

MILISECONDS -> MILLISECONDS

Comment says every 20ms, so this should be 20 not 10 (or just fix the comment).

76 ↗(On Diff #5750)

This statement can be more concise:

if (stopRequest) {
    // A stop request was made.
    LOCK(cs_running);
    running = false;
    cond_running.notify_all();
}
return running;
src/test/avalanche_tests.cpp
179 ↗(On Diff #5750)

taht -> , so or , so that

This revision now requires changes to proceed.Nov 11 2018, 23:20
deadalnix added inline comments.
src/avalanche.cpp
76 ↗(On Diff #5750)

More concise and also incorrect.

Fix various typos and inconsistent comments

Fabien added inline comments.
src/avalanche.cpp
81 ↗(On Diff #5757)

You may add braces surrounding LOCK and running=false to (slightly) reduce the scope of the lock.

This revision is now accepted and ready to land.Nov 12 2018, 21:51
deadalnix added inline comments.
src/avalanche.cpp
81 ↗(On Diff #5757)

That would introduce a race condition.

deadalnix changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".Nov 21 2018, 13:15
This revision is now accepted and ready to land.Nov 22 2018, 18:22
This revision was automatically updated to reflect the committed changes.