[0/5] Add new helper functions+macros to libsupport and use them in some nptl tests
mbox series

Message ID cover.72079c6b2f406499e2ce64755c03c43050b698b8.1556830454.git-series.mac@mcrowe.com
Headers show
Series
  • Add new helper functions+macros to libsupport and use them in some nptl tests
Related show

Message

Mike Crowe May 2, 2019, 8:54 p.m. UTC
In preparation for adding support for the _clockwait family of
functions, modify various tests to:

1. use struct timespec rather than struct timeval

2. use libsupport.

This requires adding a new support/timespec.h and support/xtime.h
containing helper functions and macros along with timespec_sub and
timespec_add implementations from gnulib.

Thanks to Adhemerval Zanella for providing lots of help and advice
with these patches.

Changes since v2[2]:

* A few more whitespace fixes

* Reformat copyright notices in timespec-add.c and timespec-sub.c to
  match those used in posix/getopt.c which also comes from gnulib.

* xclock_gettime use FAIL_EXIT1 rather than xpthread_check_return.

* timespec.c: stop preserving errno.

* tst-sem5: Reinstate comment describing length of wait.

* Fix change log in commit message to match actual ChangeLog addition.

* Use xpthread_join in tst-abstime.c.

Changes since v1[1]:

* Many whitespace fixes.

* The check macros in timespec.h now call out-of-line functions rather
  than containing the code themselves.

* Take better timespec_add and timespec_sub implementations from
  gnulib.

* Use xclock_gettime in more places.

* Split addition of support/timespec.h into a separate patch.

* Combine two separate rwlock patches into one to hopefully make
  review easier.

* Use even more x* wrapper functions.

[1] https://lwn.net/ml/libc-alpha/cover.13c2d68f411f9010956e8e52edfbe168964e1e5c.1553797867.git-series.mac%40mcrowe.com/
[2] https://lwn.net/ml/libc-alpha/cover.418ef3e533dac34f464166a596c7f6adeeb5d5d1.1554665560.git-series.mac%40mcrowe.com/

Mike Crowe (5):
  support: Add xclock_gettime
  nptl: Convert tst-cond11.c to use libsupport
  nptl: Use recent additions to libsupport in tst-sem5
  nptl: Convert some rwlock tests to use libsupport
  nptl/tst-abstime: Use libsupport

 ChangeLog                |  49 ++++++++++++-
 nptl/tst-abstime.c       |  70 ++++-------------
 nptl/tst-cond11.c        | 169 ++++++++--------------------------------
 nptl/tst-rwlock14.c      | 122 ++++-------------------------
 nptl/tst-rwlock6.c       | 146 ++++++-----------------------------
 nptl/tst-rwlock7.c       | 119 ++++++----------------------
 nptl/tst-rwlock9.c       |  96 +++++------------------
 nptl/tst-sem5.c          |  21 +----
 support/Makefile         |   4 +-
 support/README           |   6 +-
 support/timespec-add.c   |  71 +++++++++++++++++-
 support/timespec-sub.c   |  71 +++++++++++++++++-
 support/timespec.c       |  58 ++++++++++++++-
 support/timespec.h       |  79 +++++++++++++++++++-
 support/xclock_gettime.c |  31 +++++++-
 support/xtime.h          |  33 ++++++++-
 16 files changed, 558 insertions(+), 587 deletions(-)
 create mode 100644 support/timespec-add.c
 create mode 100644 support/timespec-sub.c
 create mode 100644 support/timespec.c
 create mode 100644 support/timespec.h
 create mode 100644 support/xclock_gettime.c
 create mode 100644 support/xtime.h

base-commit: 7dfde28a211400dc3b52610198478325a487e02b

Comments

Mike Crowe May 3, 2019, 8:38 p.m. UTC | #1
On Thursday 02 May 2019 at 21:54:30 +0100, Mike Crowe wrote:
> In preparation for adding support for the _clockwait family of
> functions, modify various tests to:
> 
> 1. use struct timespec rather than struct timeval
> 
> 2. use libsupport.
> 
> This requires adding a new support/timespec.h and support/xtime.h
> containing helper functions and macros along with timespec_sub and
> timespec_add implementations from gnulib.
> 
> Thanks to Adhemerval Zanella for providing lots of help and advice
> with these patches.

This series should have been marked PATCHv3 in the subject lines. Sorry. :(

Mike.