You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale-android/cmd
Elias Naur b151de039b cmd/tailscale: simplify non-blocking coalescing channels
Three variables are used everywhere a single non-blocking producer sends
values where only the latest is relevant:

    var (
	    mu sync.Mutex
	    latest T
	    notify = make(chan struct{}, 1)
    )

By draining the notification channel before sending through it, we
can simplify to just one channel:

    latest = make(chan T, 1)

Thanks to Chris Waldon for showing me this neat trick.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
5 years ago
..
tailscale cmd/tailscale: simplify non-blocking coalescing channels 5 years ago