HomePhabricator

net: Drop CNodeRef for AttemptToEvictConnection
cca221fd211fUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

net: Drop CNodeRef for AttemptToEvictConnection

Locking for each operation here is unnecessary, and solves the wrong problem.
Additionally, it introduces a problem when cs_vNodes is held in an owning
class, to which invididual CNodeRefs won't have access.

These should be weak pointers anyway, once vNodes contain shared pointers.

Rather than using a refcounting class, use a 3-step process instead.

  1. Lock vNodes long enough to snapshot the fields necessary for comparing
  2. Unlock and do the comparison
  3. Re-lock and mark the resulting node for disconnection if it still exists

Details

Provenance
Cory Fields <cory-nospam-@coryfields.com>Authored on Apr 18 2016, 19:58
deadalnixPushed on May 14 2017, 22:04
Parents
rABC563f375cdeae: net: use the exposed GetNodeSignals() rather than g_signals directly
Branches
Unknown
Tags
Unknown

Event Timeline

Cory Fields <cory-nospam-@coryfields.com> committed rABCcca221fd211f: net: Drop CNodeRef for AttemptToEvictConnection (authored by Cory Fields <cory-nospam-@coryfields.com>).May 5 2016, 17:22