kvm: wake up all waiter of vCPU.state
Now we call FUTEX_WAKE with ^uintptr(0) of waiters, but in this case only one waiter will be waked up. If we want to wake up all of them, the number of waiters has to be set to math.MaxInt32. PiperOrigin-RevId: 258285286
This commit is contained in:
parent
3d78baf06d
commit
6a8ff6daef
|
@ -21,6 +21,7 @@ package kvm
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
@ -134,7 +135,7 @@ func (c *vCPU) notify() {
|
|||
syscall.SYS_FUTEX,
|
||||
uintptr(unsafe.Pointer(&c.state)),
|
||||
linux.FUTEX_WAKE|linux.FUTEX_PRIVATE_FLAG,
|
||||
^uintptr(0), // Number of waiters.
|
||||
math.MaxInt32, // Number of waiters.
|
||||
0, 0, 0)
|
||||
if errno != 0 {
|
||||
throw("futex wake error")
|
||||
|
|
Loading…
Reference in New Issue