Revert "cmd/tailscaled, ipn/{ipnlocal,ipnserver}: let netstack get access to LocalBackend"

This reverts commit 2bc518dcb2.

@namansood didn't end up needing it in his 770aa71ffb.
This commit is contained in:
Brad Fitzpatrick
2021-03-16 12:33:13 -07:00
parent 9eb65601ef
commit 27c4dd9a97
3 changed files with 0 additions and 40 deletions

View File

@@ -1,28 +0,0 @@
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ipnlocal
import "sync"
// LocalBackendFuture is a Future that returns a *LocalBackend.
type LocalBackendFuture struct {
getOnce sync.Once
ch chan *LocalBackend
v *LocalBackend
}
func (f *LocalBackendFuture) Get() *LocalBackend {
f.getOnce.Do(f.get)
return f.v
}
func (f *LocalBackendFuture) get() { f.v = <-f.ch }
func (f *LocalBackendFuture) Set(v *LocalBackend) { f.ch <- v }
func NewLocalBackendFuture() *LocalBackendFuture {
return &LocalBackendFuture{
ch: make(chan *LocalBackend, 1),
}
}