Skip to content

Commit

Permalink
Update cpu.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kolinfluence authored Mar 16, 2024
1 parent 89fd2a8 commit 565e716
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions thread/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func init() {
//cpu core 1 == 2
func SetCPUAffinity(cpu uint16) error {
var newMask unix.CPUSet
newMask.Zero()
newMask.Set(int(cpu) - 1)
return unix.SchedSetaffinity(0, &newMask)
}
Expand Down

0 comments on commit 565e716

Please sign in to comment.