summaryrefslogtreecommitdiff
path: root/tests/test-lock.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* tests: Refactor.Bruno Haible2020-07-011-154/+2
| | | | | | * tests/atomic-int-gnulib.h: New file, extracted from tests/test-lock.c. * tests/test-lock.c: Include it. Remove the corresponding code. * modules/lock-tests (Files): Add tests/atomic-int-gnulib.h.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* New options --enable-threads=isoc and --enable-threads=isoc+posix.Bruno Haible2019-11-271-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Accept the options --enable-threads=isoc and --enable-threads=isoc+posix. (gl_THREADLIB_BODY): Test whether the ISO C threads API is available. When both the ISO C and the POSIX threads API are available, choose USE_ISOC_AND_POSIX_THREADS instead of USE_POSIX_THREADS if --enable-threads=isoc+posix was specified. When only the ISO C threads API is available and --enable-threads=iso was specified, choose USE_ISOC_THREADS. * lib/glthread/lock.h: Add new code for USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS. * lib/glthread/lock.c: Likewise. * lib/glthread/cond.h: Likewise. * lib/glthread/cond.c: Likewise. * lib/glthread/tls.h: Likewise. * lib/glthread/tls.c: Likewise. * lib/glthread/yield.h: Likewise. * lib/glthread/thread.h: Add new code for USE_ISOC_THREADS. Treat USE_ISOC_AND_POSIX_THREADS like USE_POSIX_THREADS. * lib/glthread/thread.c: Likewise. * lib/glthread/threadlib.c: Likewise. * tests/test-lock.c: Save and restore the values of USE_ISOC_THREADS and USE_ISOC_AND_POSIX_THREADS. * tests/test-cond.c: Consider USE_ISOC_THREADS and USE_ISOC_AND_POSIX_THREADS. * tests/test-tls.c: Likewise. * tests/test-thread_create.c (main): Likewise. * tests/test-pthread-cond.c: Likewise. * tests/test-pthread-mutex.c: Likewise. * tests/test-pthread-once2.c: Likewise. * tests/test-pthread-rwlock.c: Likewise. * tests/test-pthread-tss.c: Likewise. * tests/test-pthread_sigmask2.c: Treat USE_ISOC_AND_POSIX_THREADS like USE_POSIX_THREADS.
* thread, lock, cond, tls: Remove support for Pth threads.Bruno Haible2019-07-061-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document --enable-threads=pth any more. (gl_THREADLIB_BODY): Don't set USE_PTH_THREADS any more. * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Update comment. * m4/threads.m4 (gl_THREADS_H): Remove test for conflict between Pth threads and ISO C11 threads. * lib/glthread/thread.h: Remove code for USE_PTH_THREADS. * lib/glthread/lock.h: Likewise. * lib/glthread/lock.c: Likewise. * lib/glthread/cond.h: Likewise. * lib/glthread/cond.c: Likewise. * lib/glthread/tls.h: Likewise. * lib/glthread/tls.c: Likewise. * lib/glthread/yield.h: Likewise. * lib/regex_internal.h: Likewise. * tests/test-thread_create.c: Likewise. * tests/test-lock.c: Likewise. * tests/test-cond.c: Likewise. * tests/test-tls.c: Likewise. * tests/test-rwlock1.c: Don't include glthread/yield.h. (main): Sleep without calling gl_thread_yield.
* thread, lock, cond, tls: Remove support for old Solaris threads.Bruno Haible2019-07-061-8/+1
| | | | | | | | | | | | | | | | | | | | | | Solaris >= 2.5.1 has POSIX threads. * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document --enable-threads=solaris any more. (gl_THREADLIB_BODY): Don't set USE_SOLARIS_THREADS any more. * lib/glthread/thread.c: Update comment. * lib/glthread/thread.h: Remove code for USE_SOLARIS_THREADS. * lib/glthread/lock.h: Likewise. * lib/glthread/lock.c: Likewise. * lib/glthread/cond.h: Likewise. * lib/glthread/cond.c: Likewise. * lib/glthread/tls.h: Likewise. * lib/glthread/tls.c: Likewise. * lib/glthread/yield.h: Likewise. * lib/regex_internal.h: Likewise. * tests/test-thread_create.c: Likewise. * tests/test-lock.c: Likewise. * tests/test-cond.c: Likewise. * tests/test-tls.c: Likewise.
* lock tests: Avoid reference to undefined variable if !ENABLE_LOCKING.Bruno Haible2019-06-201-0/+2
| | | | | * tests/test-lock.c (test_once): Don't reference fire_signal if !ENABLE_LOCKING.
* lock tests: Prevent that the test takes too long.Bruno Haible2019-04-281-0/+13
| | | | | | * tests/test-lock.c: Include <signal.h>, <unistd.h>. (main): Let the test fail if it takes more than 10 minutes. * modules/lock-tests (configure.ac): Test whether 'alarm' is declared.
* Fix gcc warnings on 64-bit mode mingw.Bruno Haible2019-04-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/clean-temp.c: Include <stdint.h> instead of defining uintptr_t. * lib/gl_array_list.c: Likewise. * lib/gl_array_map.c: Likewise. * lib/gl_array_set.c: Likewise. * lib/gl_carray_list.c: Likewise. * lib/gl_sublist.c: Likewise. * lib/gl_avltreehash_list.c (uintptr_t): Remove definition. * lib/gl_rbtreehash_list.c (uintptr_t): Likewise. * lib/gl_hash_map.c (uintptr_t): Likewise. * lib/gl_hash_set.c (uintptr_t): Likewise. * lib/gl_linkedhash_list.c (uintptr_t): Likewise. * lib/gl_linkedhash_map.c (uintptr_t): Likewise. * lib/gl_linkedhash_set.c (uintptr_t): Likewise. * lib/iconv.c (uintptr_t): Likewise. * lib/iconv_close.c (uintptr_t): Likewise. * tests/test-lock.c: Include <stdint.h>. (once_contender_thread, test_once): Cast through 'intptr_t' instead of 'long'. * modules/clean-temp (Depends-on): Add stdint. * modules/array-list (Depends-on): Likewise. * modules/array-map (Depends-on): Likewise. * modules/array-set (Depends-on): Likewise. * modules/carray-list (Depends-on): Likewise. * modules/sublist (Depends-on): Likewise. * modules/lock-tests (Depends-on): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* lock tests: Fix test failure on Mac OS X (regression from 2017-01-05).Bruno Haible2017-03-031-3/+58
| | | | | | | | | Reported by Assaf Gordon <assafgordon@gmail.com> via Pádraig Brady <P@draigBrady.com>. * tests/test-lock.c: On Mac OS X, use named semaphores, not unnamed semaphores. (USE_NAMED_SEMAPHORE, USE_UNNAMED_SEMAPHORE): New macros. (atomic_int_semaphore): New macro.
* lock tests: Fix build failure on z/OS.Bruno Haible2017-02-201-1/+1
| | | | | | | Reported by Daniel Richard G. <skunk@iskunk.org>. * modules/lock-tests (configure.ac): Test for <semaphore.h>. * tests/test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not exist.
* lock tests: Prefer semaphore over mutex.Bruno Haible2017-01-051-4/+51
| | | | | | | * tests/test-lock.c (USE_SEMAPHORE): New constant. (struct atomic_int, init_atomic_int, get_atomic_int_value, set_atomic_int_value) [USE_SEMAPHORE]: Define using a POSIX semaphore. Suggested by Torvald Riegel <triegel@redhat.com>.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* lock test: Fix performance problem on multi-core machines.Bruno Haible2016-12-241-12/+67
| | | | | | | | | | | | | | | * tests/test-lock.c (USE_VOLATILE): New macro. (struct atomic_int): New type. (init_atomic_int, get_atomic_int_value, set_atomic_int_value): New functions. (lock_checker_done, rwlock_checker_done, reclock_checker_done): Define as 'struct atomic_int'. (lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock, reclock_checker_thread, test_recursive_lock): Use the new functions. Reported by Eric Blake in https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html and by Pádraig Brady in http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: spelling fixesPaul Eggert2012-02-051-2/+2
|
* Talk about "native Windows API", not "Win32".Bruno Haible2012-01-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/classpath.c: Update comments to mention native Windows. * lib/csharpexec.c: Likewise. * lib/dup2.c: Likewise. * lib/error.c: Likewise. * lib/fcntl.c: Likewise. * lib/filename.h: Likewise. * lib/findprog.c: Likewise. * lib/get-rusage-as.c: Likewise. * lib/get-rusage-data.c: Likewise. * lib/getpagesize.c: Likewise. * lib/javaexec.c: Likewise. * lib/msvc-inval.c: Likewise. * lib/msvc-nothrow.c: Likewise. * lib/nanosleep.c: Likewise. * lib/nonblocking.c: Likewise. * lib/printf-parse.c: Likewise. * lib/setlocale.c: Likewise. * lib/sigaction.c: Likewise. * lib/strerror_r.c: Likewise. * lib/tmpdir.c: Likewise. * lib/vasnprintf.c: Likewise. * lib/w32spawn.h: Likewise. * lib/waitpid.c: Likewise. * lib/stdio.in.h (fdopen, fopen, freopen): Likewise. * m4/locale-ar.m4: Likewise. * m4/locale-fr.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale-tr.m4: Likewise. * m4/locale-zh.m4: Likewise. * m4/printf.m4: Likewise. * tests/test-cloexec.c: Likewise. * tests/test-copy-acl.sh: Likewise. * tests/test-copy-file.sh: Likewise. * tests/test-file-has-acl.sh: Likewise. * tests/test-set-mode-acl.sh: Likewise. * tests/test-dup-safer.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-dup3.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-pipe.c: Likewise. * tests/test-pipe2.c: Likewise. * tests/test-spawn-pipe-child.c: Likewise. * doc/acl-resources.txt: Likewise. * lib/getaddrinfo.c (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. * tests/test-poll.c (WINDOWS_NATIVE): Likewise. * tests/test-select.h (WINDOWS_NATIVE): Likewise. * lib/localcharset.c: Update comments to mention native Windows. (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. * lib/localename.c: Likewise. * lib/progreloc.c: Likewise. * lib/relocatable.c: Likewise. * lib/poll.c (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. (windows_compute_revents): Renamed from win32_compute_revents. (windows_compute_revents_socket): Renamed from win32_compute_revents_socket. * lib/select.c: Update comments to mention native Windows. (windows_poll_handle): Renamed from win32_poll_handle. * m4/threadlib.m4: Update comments to mention native Windows. (gl_THREADLIB_EARLY_BODY, gl_THREADLIB_BODY): Expect --enable-threads=windows instead of --enable-threads=win32. Set USE_WINDOWS_THREADS, not USE_WIN32_THREADS. * lib/glthread/lock.h: Update comments to mention native Windows. (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. * lib/glthread/lock.c (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. * lib/glthread/cond.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/cond.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/thread.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/thread.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/tls.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/tls.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/yield.h (USE_WINDOWS_THREADS): Likewise. * tests/test-cond.c (USE_WINDOWS_THREADS): Likewise. * tests/test-thread_create.c (USE_WINDOWS_THREADS): Likewise. * tests/test-lock.c (USE_WINDOWS_THREADS): Likewise. (TEST_WINDOWS_THREADS): Renamed from TEST_WIN32_THREADS. * tests/test-tls.c: Likewise. Rationale: Microsoft renamed the "Win32 API" to "Windows API", as it is available on both 32-bit and 64-bit Windows systems. But in gnulib, we treat Cygwin like a Unix platform, therefore the main line of distinction is between "native Windows" on one side and Unix/ POSIX systems on the other side. More details in <https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00027.html>. Suggested by Paul Eggert.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* thread: Support pthreads-win32.Bruno Haible2011-06-091-30/+30
| | | | | | | | | | | | * lib/glthread/thread.h (gl_thread_self): Define differently on pthreads-win32. (gl_null_thread): New declaration. (gl_thread_self_pointer): New macro. * lib/glthread/thread.c (gl_null_thread): New constant. * tests/test-lock.c: Use gl_thread_self_pointer instead of gl_thread_self. * tests/test-tls.c: Likewise. Suggested by Paul Eggert. Reported by Eric Blake.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* Minor formatting changes.Bruno Haible2010-03-251-6/+6
|
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-28/+28
|
* Avoid gcc -Wmissing-prototypes warnings.Bruno Haible2008-12-081-4/+19
|
* Make use of the modules 'thread', 'yield' in the 'lock' test.Bruno Haible2008-10-011-129/+25
|
* Tweak skip message.Bruno Haible2008-09-221-1/+1
|
* test-lock, test-tls: mention why a test is skippedEric Blake2008-08-221-0/+3
| | | | | | | | * tests/test-lock.c (main) [!USE_*_THREADS]: Print why test is skipped. * tests/test-tls.c (main) [!USE_*_THREADS]: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Move the lock and tls source files into a subdirectory.Bruno Haible2008-08-141-2/+2
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Unconditionally include <config.h> in unit tests.Eric Blake2007-05-281-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-alloca-opt.c: Remove #ifdef HAVE_CONFIG_H. * tests/test-allocsa.c, tests/test-arcfour.c, tests/test-arctwo.c, tests/test-argmatch.c, tests/test-argp.c, tests/test-array_list.c, tests/test-array_oset.c, tests/test-atexit.c, test-avltree_list.c, test-avltree_oset.c, test-avltreehash_list.c, test-base64.c, test-binary-io.c, test-c-ctype.c, test-c-strcasecmp.c, test-c-strcasestr.c, test-c-strncasecmp.c, test-c-strstr.c, test-canonicalize-lgpl.c, test-carray_list.c, test-crc.c, test-des.c, test-dirname.c, test-fflush.c, test-fprintf-posix.c, test-gc-arcfour.c, test-gc-arctwo.c, test-gc-des.c, test-gc-hmac-md5.c, test-gc-hmac-sha1.c, test-gc-md2.c, test-gc-md4.c, test-gc-md5.c, test-gc-pbkdf2-sha1.c, test-gc-rijndael.c, test-gc-sha1.c, test-gc.c, test-getpass.c, test-hmac-md5.c, test-hmac-sha1.c, test-iconv.c, test-linked_list.c, test-linkedhash_list.c, test-lock.c, test-mbscasecmp.c, test-mbscasestr1.c, test-mbscasestr2.c, test-mbscasestr3.c, test-mbscasestr4.c, test-mbschr.c, test-mbscspn.c, test-mbsncasecmp.c, test-mbspbrk.c, test-mbspcasecmp.c, test-mbsrchr.c, test-mbsspn.c, test-mbsstr1.c, test-mbsstr2.c, test-mbsstr3.c, test-md2.c, test-md4.c, test-md5.c, test-memmem.c, test-printf-posix.c, test-rbtree_list.c, test-rbtree_oset.c, test-rbtreehash_list.c, test-read-file.c, test-rijndael.c, test-snprintf-posix.c, test-snprintf.c, test-sprintf-posix.c, test-stdint.c, test-strcasestr.c, test-striconv.c, test-striconveh.c, test-striconveha.c, test-tls.c, test-vasnprintf-posix.c, test-vasnprintf-posix2.c, test-vasnprintf.c, test-vasprintf-posix.c, test-vasprintf.c, test-verify.c, test-vfprintf-posix.c, test-vprintf-posix.c, test-vsnprintf-posix.c, test-vsnprintf.c, test-vsprintf-posix.c, test-xvasprintf.c: Likewise.
* Add copyright notices to long-enough files that lack them, sincePaul Eggert2006-08-141-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | otherwise the files aren't clearly free. Use the same notice that getdate.texi already uses. * doc/alloca-opt.texi: Add copyright notice. * doc/alloca.texi: Likewise. * doc/ctime.texi: Likewise. * doc/functions.texi: Likewise. * doc/gcd.texi: Likewise. * doc/gnulib-tool.texi: Likewise. * doc/inet_ntoa.texi: Likewise. * doc/visibility.texi: Likewise. Change copyright notice from LGPL 2 to GPL 2, since that's the standard form used in the gnulib repository. * lib/lock.c: LGPL -> GPL. * lib/lock.h: Likewise. * lib/strnlen1.c: Likewise. * lib/strnlen1.h: Likewise. * lib/tls.c: Likewise. * lib/tls.h: Likewise. * lib/tmpdir.c: Likewise. * tests/test-lock.c: Likewise. * tests/test-stdint.c: Likewise. * tests/test-tls.c: Likewise.
* Tests for gnulib module 'lock'.Bruno Haible2005-08-251-0/+691