Commit Graph

3 Commits

Author SHA1 Message Date
Jamie Liu 9e1cbdf565 Indicate flipcall synchronization to the Go race detector.
Since each Endpoint has a distinct mapping of the packet window, the Go race
detector does not recognize accesses by connected Endpoints to be related. This
means that this change isn't necessary for the Go race detector to accept
accesses of flipcall.Endpoint.Data(), but it *is* necessary for it to accept
accesses to shared variables outside the scope of flipcall that are
synchronized by flipcall.Endpoint state; see updated test for an example.

RaceReleaseMerge is needed (instead of RaceRelease) because calls to
raceBecomeInactive() from *unrelated* Endpoints can occur in any order.
(DowngradableRWMutex.RUnlock() has a similar property: calls to RUnlock() on
the same DowngradableRWMutex from different goroutines can occur in any order.
Remove the TODO asking to explain this now that this is understood.)

PiperOrigin-RevId: 267705325
2019-09-06 17:25:07 -07:00
Jamie Liu eb94066ef2 Ensure that flipcall.Endpoint.Shutdown() shuts down inactive peers.
PiperOrigin-RevId: 267022978
2019-09-03 15:10:51 -07:00
Jamie Liu cbe145247a Flipcall refinements.
Note that some of these changes affect the protocol in
backward-incompatible ways.

- Replace use of "initially-active" and "initially-inactive" with
"client" and "server" respectively for clarity.

- Fix a race condition involving Endpoint.Shutdown() by repeatedly
invoking FUTEX_WAKE until it is confirmed that no local thread is
blocked in FUTEX_WAIT.

- Drop flipcall.ControlMode.

PiperOrigin-RevId: 260981382
2019-07-31 12:56:04 -07:00