Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 May 2013 18:18:59 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r250284 - user/dchagin/lemul/sys/compat/linux
Message-ID:  <201305051818.r45IIxRg092422@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305051818.r45IIxRg092422>