Skip to content

Commit 30110dd

Browse files
authored
Update cpu.go
1 parent 48aa01b commit 30110dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

thread/cpu.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ var (
1616

1717
func init() {
1818
NumCPU = uint16(runtime.NumCPU())
19-
pflag.Uint16VarP(&CPUThread, "CPUThread", "t", 0, "prefork child id")
20-
2119
//Parse it in main
2220
// pflag.Parse() //parse at cxcputhread as it's very important, preparsing with another "flag" module before calling cxcputhread
2321
}
2422

23+
func DefineFlags() {
24+
pflag.Uint16VarP(&CPUThread, "CPUThread", "t", 0, "prefork child id")
25+
}
26+
2527
//cpu core 0 == 1
2628
//cpu core 1 == 2
2729
func SetCPUAffinity(cpu uint16) error {

0 commit comments

Comments
 (0)