Go to file
Mike Crowe b789efeae8 libstdc++: Fix try_lock_until and try_lock_shared_until on arbitrary clock
This is the equivalent to PR libstdc++/91906, but for shared_mutex.

A non-standard clock may tick more slowly than std::chrono::steady_clock.
This means that we risk returning false early when the specified timeout
may not have expired. This can be avoided by looping until the timeout time
as reported by the non-standard clock has been reached.

Unfortunately, we have no way to tell whether the non-standard clock ticks
more quickly that std::chrono::steady_clock. If it does then we risk
returning later than would be expected, but that is unavoidable without
waking up periodically to check, which would be rather too expensive.

François Dumont pointed out[1] a flaw in an earlier version of this patch
that revealed a hole in the test coverage, so I've added a new test that
try_lock_until acts as try_lock if the timeout has already expired.

[1] https://gcc.gnu.org/ml/libstdc++/2019-10/msg00021.html

2019-12-02  Mike Crowe  <mac@mcrowe.com>

	Fix try_lock_until and try_lock_shared_until on arbitrary clock
	* include/std/shared_mutex (shared_timed_mutex::try_lock_until)
	(shared_timed_mutex::try_lock_shared_until): Loop until the absolute
	timeout time is reached as measured against the appropriate clock.
	* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
	file. Test try_lock_until and try_lock_shared_until timeouts against
	various clocks.
	* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
	file. Test try_lock_until and try_lock_shared_until timeouts against
	various clocks.

From-SVN: r278904
2019-12-02 16:23:14 +00:00
config
contrib download_prerequisites: Use http instead of ftp for downloading. 2019-11-13 19:48:52 +02:00
fixincludes
gcc Refactor IPA devirt a bit. 2019-12-02 11:18:31 +00:00
gnattools
gotools
include [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1 typeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error messages. 2019-11-25 13:49:50 +00:00
libcpp Support UTF-8 character constants for C2x. 2019-11-14 20:18:33 +00:00
libdecnumber
libffi
libgcc fix ChangeLog to reference the PR 2019-11-18 12:46:56 +00:00
libgfortran re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output) 2019-12-01 22:29:43 +00:00
libgo re PR go/92605 (r278509 causes/reveals issue in building go library) 2019-11-21 01:06:47 +00:00
libgomp Fortran] OpenACC – permit common blocks in some clauses 2019-11-29 14:59:21 +01:00
libhsail-rt
libiberty [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
libitm
libobjc Unbreak objc build – with --enable-maintainer-mode 2019-11-26 21:16:30 +01:00
liboffloadmic
libphobos
libquadmath
libsanitizer re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer) 2019-11-26 10:08:31 +01:00
libssp
libstdc++-v3 libstdc++: Fix try_lock_until and try_lock_shared_until on arbitrary clock 2019-12-02 16:23:14 +00:00
libvtv
lto-plugin
maintainer-scripts Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
zlib
.dir-locals.el
.gitattributes * .gitattributes: Also check ChangeLog whitespace. 2019-10-21 23:12:04 -04:00
.gitignore
ABOUT-NLS
ar-lib
ChangeLog PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
configure.ac PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS Remove my name from AArch64 port maintainers 2019-11-20 09:29:13 +00:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.