Skip to content

Commit 38b9b00

Browse files
authored
Merge pull request #243 from yaoyinnan/242/cgroupv2-addThread
Support cgroup.AddThread in cgroupv2 manager
2 parents e8a4323 + 640c206 commit 38b9b00

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

v2/manager.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,14 @@ func (c *Manager) AddProc(pid uint64) error {
336336
return writeValues(c.path, []Value{v})
337337
}
338338

339+
func (c *Manager) AddThread(tid uint64) error {
340+
v := Value{
341+
filename: cgroupThreads,
342+
value: tid,
343+
}
344+
return writeValues(c.path, []Value{v})
345+
}
346+
339347
func (c *Manager) Delete() error {
340348
return remove(c.path)
341349
}

v2/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737

3838
const (
3939
cgroupProcs = "cgroup.procs"
40+
cgroupThreads = "cgroup.threads"
4041
defaultDirPerm = 0755
4142
)
4243

0 commit comments

Comments
 (0)