svn commit: r250284 - user/dchagin/lemul/sys/compat/linux
Dmitry Chagin
dchagin at FreeBSD.org
Sun May 5 18:18:59 UTC 2013
Author: dchagin
Date: Sun May 5 18:18:58 2013
New Revision: 250284
URL: http://svnweb.freebsd.org/changeset/base/250284
Log:
Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME flag has
been added instead of FUTEX_WAIT to replace the FUTEX_WAIT logic which needs
to do gettimeofday() calls before and after the futex syscall to convert
the absolute timeout to a relative timeout. Before this the CLOCK_MONOTONIC
used by the FUTEX_WAIT_BITSET op.
Properly calculate the timeout for the CLOCK_MONOTONIC case.
Modified:
user/dchagin/lemul/sys/compat/linux/linux_futex.c
Modified: user/dchagin/lemul/sys/compat/linux/linux_futex.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_futex.c Sun May 5 18:08:30 2013 (r250283)
+++ user/dchagin/lemul/sys/compat/linux/linux_futex.c Sun May 5 18:18:58 2013 (r250284)
@@ -753,6 +753,9 @@ linux_sys_futex(struct thread *td, struc
if (clockrt) {
microtime(&ctv);
timevalsub(&utv, &ctv);
+ } else if (args->op == LINUX_FUTEX_WAIT_BITSET) {
+ microuptime(&ctv);
+ timevalsub(&utv, &ctv);
}
if (utv.tv_sec < 0)
timevalclear(&utv);
More information about the svn-src-user
mailing list