Skip to content

Commit

Permalink
Merge pull request #243 from yaoyinnan/242/cgroupv2-addThread
Browse files Browse the repository at this point in the history
Support cgroup.AddThread in cgroupv2 manager
  • Loading branch information
dmcgowan committed Sep 20, 2022
2 parents e8a4323 + 640c206 commit 38b9b00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ func (c *Manager) AddProc(pid uint64) error {
return writeValues(c.path, []Value{v})
}

func (c *Manager) AddThread(tid uint64) error {
v := Value{
filename: cgroupThreads,
value: tid,
}
return writeValues(c.path, []Value{v})
}

func (c *Manager) Delete() error {
return remove(c.path)
}
Expand Down
1 change: 1 addition & 0 deletions v2/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (

const (
cgroupProcs = "cgroup.procs"
cgroupThreads = "cgroup.threads"
defaultDirPerm = 0755
)

Expand Down

0 comments on commit 38b9b00

Please sign in to comment.