mirror of
https://github.com/moby/moby.git
synced 2026-07-23 07:51:53 +00:00
Merge pull request #1911 from cpuguy83/fix_missing_lockosthread_master
Lock goroutine to OS thread while changing NS
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -81,6 +82,10 @@ func setDefaultVlan() {
|
||||
logrus.Error("insufficient number of arguments")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
nsPath := os.Args[1]
|
||||
ns, err := netns.GetFromPath(nsPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user