mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
00b2c13a1b
Fix build constraints for linux-only network drivers Signed-off-by: Brian Goff <cpuguy83@gmail.com>
27 lines
597 B
Go
27 lines
597 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/docker/docker/pkg/signal"
|
|
"github.com/sirupsen/logrus"
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// Copied over from docker/daemon/debugtrap_windows.go
|
|
func setupDumpStackTrap() {
|
|
go func() {
|
|
sa := windows.SecurityAttributes{
|
|
Length: 0,
|
|
}
|
|
ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + fmt.Sprint(os.Getpid()))
|
|
if h, _ := windows.CreateEvent(&sa, 0, 0, ev); h != 0 {
|
|
logrus.Debugf("Stackdump - waiting signal at %d", *ev)
|
|
for {
|
|
windows.WaitForSingleObject(h, windows.INFINITE)
|
|
signal.DumpStacks("")
|
|
}
|
|
}
|
|
}()
|
|
}
|