Refactor epoll monitor for generic use
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
b6bf350a07
commit
97c3c3847a
10 changed files with 288 additions and 297 deletions
|
@ -67,7 +67,7 @@ type OOM interface {
|
|||
io.Closer
|
||||
FD() int
|
||||
ContainerID() string
|
||||
Flush()
|
||||
Flush() error
|
||||
Removed() bool
|
||||
}
|
||||
|
||||
|
@ -692,9 +692,10 @@ func (o *oom) FD() int {
|
|||
return o.eventfd
|
||||
}
|
||||
|
||||
func (o *oom) Flush() {
|
||||
func (o *oom) Flush() error {
|
||||
buf := make([]byte, 8)
|
||||
syscall.Read(o.eventfd, buf)
|
||||
_, err := syscall.Read(o.eventfd, buf)
|
||||
return err
|
||||
}
|
||||
|
||||
func (o *oom) Removed() bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue