>From 36307d84f7bed226e8059c61ea611cf01b1dfdc4 Mon Sep 17 00:00:00 2001 From: Bruno Haible
Date: Thu, 20 Jun 2019 04:32:42 +0200 Subject: [PATCH 20/26] cnd: New module. * lib/cnd.c: New file. * modules/cnd: New file. * doc/posix-functions/cnd_init.texi: Mention the new module. * doc/posix-functions/cnd_wait.texi: Likewise. * doc/posix-functions/cnd_timedwait.texi: Likewise. * doc/posix-functions/cnd_signal.texi: Likewise. * doc/posix-functions/cnd_broadcast.texi: Likewise. * doc/posix-functions/cnd_destroy.texi: Likewise. --- ChangeLog | 12 +++ doc/posix-functions/cnd_broadcast.texi | 8 +- doc/posix-functions/cnd_destroy.texi | 8 +- doc/posix-functions/cnd_init.texi | 8 +- doc/posix-functions/cnd_signal.texi | 8 +- doc/posix-functions/cnd_timedwait.texi | 8 +- doc/posix-functions/cnd_wait.texi | 8 +- lib/cnd.c | 185 +++++++++++++++++++++++++++++++++ modules/cnd | 31 ++++++ 9 files changed, 252 insertions(+), 24 deletions(-) create mode 100644 lib/cnd.c create mode 100644 modules/cnd diff --git a/ChangeLog b/ChangeLog index 0e73bd6..68eeea7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2019-06-20 Bruno Haible + cnd: New module. + * lib/cnd.c: New file. + * modules/cnd: New file. + * doc/posix-functions/cnd_init.texi: Mention the new module. + * doc/posix-functions/cnd_wait.texi: Likewise. + * doc/posix-functions/cnd_timedwait.texi: Likewise. + * doc/posix-functions/cnd_signal.texi: Likewise. + * doc/posix-functions/cnd_broadcast.texi: Likewise. + * doc/posix-functions/cnd_destroy.texi: Likewise. + +2019-06-20 Bruno Haible + mtx: New module. * lib/mtx.c: New file. * modules/mtx: New file. diff --git a/doc/posix-functions/cnd_broadcast.texi b/doc/posix-functions/cnd_broadcast.texi index a11d52d..e44a908 100644 --- a/doc/posix-functions/cnd_broadcast.texi +++ b/doc/posix-functions/cnd_broadcast.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/doc/posix-functions/cnd_destroy.texi b/doc/posix-functions/cnd_destroy.texi index 1ae39fd..13783a3 100644 --- a/doc/posix-functions/cnd_destroy.texi +++ b/doc/posix-functions/cnd_destroy.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/doc/posix-functions/cnd_init.texi b/doc/posix-functions/cnd_init.texi index 55c7489..a741303 100644 --- a/doc/posix-functions/cnd_init.texi +++ b/doc/posix-functions/cnd_init.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/doc/posix-functions/cnd_signal.texi b/doc/posix-functions/cnd_signal.texi index 83071e5..22e2ecc 100644 --- a/doc/posix-functions/cnd_signal.texi +++ b/doc/posix-functions/cnd_signal.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/doc/posix-functions/cnd_timedwait.texi b/doc/posix-functions/cnd_timedwait.texi index 3fa6985..0b5f29d 100644 --- a/doc/posix-functions/cnd_timedwait.texi +++ b/doc/posix-functions/cnd_timedwait.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/doc/posix-functions/cnd_wait.texi b/doc/posix-functions/cnd_wait.texi index 89e9864..626a6aa 100644 --- a/doc/posix-functions/cnd_wait.texi +++ b/doc/posix-functions/cnd_wait.texi @@ -10,15 +10,15 @@ Documentation:@* @url{https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html}. @end ifnotinfo -Gnulib module: --- +Gnulib module: cnd Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.27, Mac OS X 10.5, FreeBSD 9.3, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0. @end itemize diff --git a/lib/cnd.c b/lib/cnd.c new file mode 100644 index 0000000..48c4854 --- /dev/null +++ b/lib/cnd.c @@ -0,0 +1,185 @@ +/* ISO C 11 condition variables for multithreading. + Copyright (C) 2008-2019 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see