From b9ad0fbf286ada6cdb6b86f351196369cf703c73 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 29 Aug 2020 21:08:31 +0200 Subject: Cygwin: pthreads: iterate over key destructors per POSIX POSIX requires that key destructors are called in a loop for each key with a non-NULL value until all values are NULL, or until all destructors for non-NULL values have been called at least PTHREAD_DESTRUCTOR_ITERATIONS (per POSIX: 4) times. Cygwinonly called all destructors with non-NULL values exactly once. This patch fixes Cygwin to follow POSIX. Signed-off-by: Corinna Vinschen --- winsup/cygwin/include/limits.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'winsup/cygwin/include') diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h index 524a469e4..6a55578f3 100644 --- a/winsup/cygwin/include/limits.h +++ b/winsup/cygwin/include/limits.h @@ -225,13 +225,8 @@ details. */ /* Maximum number of attempts made to destroy a thread's thread-specific data values on thread exit. */ -/* FIXME: I really don't understand this value. Why should multiple - attempts be necessary to destroy thread-specific data?!? Anyway, the - current value here is 1, taken originally from our pthread.h file, - where it was mistakenly defined first. Unfortunately this value is - lower than the POSIX defined minimum value, which is 4. */ #undef PTHREAD_DESTRUCTOR_ITERATIONS -#define PTHREAD_DESTRUCTOR_ITERATIONS 1 +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 /* Maximum number of data keys that can be created by a process. */ /* Tls has 1088 items - and we don't want to use them all :] */ -- cgit v1.2.3