Commit Graph

4 Commits

Author SHA1 Message Date
Mike Crowe
7a773abf7c nptl: Convert tst-sem5 & tst-sem13 to use libsupport
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/tst-sem5.c: Remove unused headers. Add <support/check.h>.
	(do_test) Use libsupport test macros rather than hand-coded
	conditionals and error messages. Ensure that sem_init returns zero
	rather than not -1. Use <support/test-driver.c> rather than
	test-skeleton.c.

	* nptl/tst-sem13.c: Add <support/check.h>. (do_test) Use libsupport
	test macros rather than hand-coded conditionals and error messages.
	Use <support/test-driver.c> rather than test-skeleton.c.
2019-03-25 10:36:43 -03:00
Carlos O'Donell
042e1521c7 Fix semaphore destruction (bug 12674).
This commit fixes semaphore destruction by either using 64b atomic
operations (where available), or by using two separate fields when only
32b atomic operations are available.  In the latter case, we keep a
conservative estimate of whether there are any waiting threads in one
bit of the field that counts the number of available tokens, thus
allowing sem_post to atomically both add a token and determine whether
it needs to call futex_wake.

See:
https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html
2015-01-21 00:46:16 -05:00
Thomas Schwinge
48aff7765b Fix 9554ebf2d4.
| Invalid timeouts in i386 sem_timedwait.
|
| We adjusted nwaiters even though this isn't necessary.
2012-03-08 09:33:12 +01:00
Ulrich Drepper
fa214705b9 Once again forgot to add new test file. 2009-11-24 18:22:30 -08:00