summaryrefslogtreecommitdiffstats
path: root/include/my_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 3e68538b..ca32fecc 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -147,9 +147,6 @@ int pthread_cancel(pthread_t thread);
#ifndef _REENTRANT
#define _REENTRANT
#endif
-#ifdef HAVE_THR_SETCONCURRENCY
-#include <thread.h> /* Probably solaris */
-#endif
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
@@ -618,9 +615,6 @@ extern int my_rw_trywrlock(my_rw_lock_t *);
#define GETHOSTBYADDR_BUFF_SIZE 2048
-#ifndef HAVE_THR_SETCONCURRENCY
-#define thr_setconcurrency(A) pthread_dummy(0)
-#endif
#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#endif
@@ -667,15 +661,19 @@ extern void my_mutex_end(void);
We need to have at least 256K stack to handle calls to myisamchk_init()
with the current number of keys and key parts.
*/
-#if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
-#ifndef DBUG_OFF
-#define DEFAULT_THREAD_STACK (1024*1024L)
-#else
-#define DEFAULT_THREAD_STACK (383*1024L) /* 392192 */
-#endif
-#else
-#define DEFAULT_THREAD_STACK (292*1024L) /* 299008 */
-#endif
+# if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
+/*
+ Optimized WITH_ASAN=ON executables produced
+ by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6
+ would fail ./mtr main.1st when the stack size is 5 MiB.
+ The minimum is more than 6 MiB for CMAKE_BUILD_TYPE=RelWithDebInfo and
+ more than 10 MiB for CMAKE_BUILD_TYPE=Debug.
+ Let us add some safety margin.
+*/
+# define DEFAULT_THREAD_STACK (11L<<20)
+# else
+# define DEFAULT_THREAD_STACK (292*1024L) /* 299008 */
+# endif
#endif
#define MY_PTHREAD_LOCK_READ 0