Oh, you are right. The current code doesn't actually prevent lock
stealer from actually stealing the lock in the special case that the
lock is in the unlock state when the HANDOFF bit is set. In this case,
How about setting the HANDOFF bit before the top-waiter first give up
cpu and fall asleep. Then It must can get the lock after being woken up,
and there is no chance happen stealing lock. And I sent a v2 with this.
it is free for all and whoever gets the lock will also clear the the
HANDOFF bit. The comment in __mutex_trylock_or_owner() about "We set the
HANDOFF bit" isn't quite right.