File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1515# Folders
1616.gopath /
1717.idea /
18- bin /
19- build /
18+ / bin /
19+ / build /
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "flag"
2020 "fmt"
2121 "os"
22+ "runtime"
2223
2324 "github.com/containernetworking/cni/pkg/skel"
2425 "github.com/containernetworking/cni/pkg/types"
@@ -34,6 +35,14 @@ import (
3435 "github.com/k8snetworkplumbingwg/rdma-cni/pkg/utils"
3536)
3637
38+ //nolint:gochecknoinits
39+ func init () {
40+ // this ensures that main runs only on main thread (thread group leader).
41+ // since namespace ops (unshare, setns) are done for a single thread, we
42+ // must ensure that the goroutine does not jump from OS thread to thread
43+ runtime .LockOSThread ()
44+ }
45+
3746// Sets the initial log level configurations
3847// this is overridden by the "debug" CNI arg
3948var (
You can’t perform that action at this time.
0 commit comments