444c444,445
< }
---
> } else if (OS::TGT_FUTEX_REQUEUE == op ||
> OS::TGT_FUTEX_CMP_REQUEUE == op) {
445a447,458
> // Ensure futex system call accessed atomically.
> BufferArg buf(uaddr, sizeof(int));
> buf.copyIn(tc->getMemProxy());
> int mem_val = *(int*)buf.bufferPtr();
> /*
> * For CMP_REQUEUE, the whole operation is only started only if
> * val3 is still the value of the futex pointed to by uaddr.
> */
> if (OS::TGT_FUTEX_CMP_REQUEUE && val3 != mem_val)
> return -OS::TGT_EWOULDBLOCK;
> return futex_map.requeue(uaddr, process->tgid(), val, timeout, uaddr2);
> }