Use notify explicitly on unlock path.

There are circumstances under which the redpill call will not generate
the appropriate action and notification. Replace this call with an
explicit notification, which is guaranteed to transition as well as
perform the futex wake.

PiperOrigin-RevId: 200726934
Change-Id: Ie19e008a6007692dd7335a31a8b59f0af6e54aaa
This commit is contained in:
Adin Scannell
2018-06-15 09:30:08 -07:00
committed by Shentubot
parent ef5dd4df9b
commit b31ac4e1df
+1 -1
View File
@@ -397,7 +397,7 @@ func (c *vCPU) unlock() {
case vCPUUser | vCPUGuest | vCPUWaiter:
// Force a transition: this must trigger a notification when we
// return from guest mode.
redpill()
c.notify()
case vCPUUser | vCPUWaiter:
// Waiting for the lock to be released; the responsibility is
// on us to notify the waiter and clear the associated bit.