mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-07 16:16:54 +00:00
magicsock: add description of testClosingContext
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
This commit is contained in:
parent
b771a1363b
commit
8349e10907
@ -543,6 +543,11 @@ func TestDeviceStartStop(t *testing.T) {
|
|||||||
dev.Close()
|
dev.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A context used in TestConnClosing() which seeks to test that code which calls
|
||||||
|
// Err() to see if a connection is already being closed does not then proceed to
|
||||||
|
// try to acquire the mutex, as this would lead to deadlock. When Err() is called
|
||||||
|
// this context acquires the lock itself, in order to force a deadlock (and test
|
||||||
|
// failure on timeout).
|
||||||
type testConnClosingContext struct {
|
type testConnClosingContext struct {
|
||||||
parent context.Context
|
parent context.Context
|
||||||
mu *sync.Mutex
|
mu *sync.Mutex
|
||||||
|
Loading…
x
Reference in New Issue
Block a user