You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6 KiB

  1. From c45b4a774b6d1404a080a1c1759f780fa78f223b Mon Sep 17 00:00:00 2001
  2. From: Sergey Vojtovich <svoj@mariadb.org>
  3. Date: Fri, 21 Sep 2018 16:04:16 +0400
  4. Subject: [PATCH] MDEV-17200 - pthread_detach called for already detached
  5. threads
  6. pthread_detach_this_thread() was intended to be defined to something
  7. meaningful only on some ancient unixes, which don't have
  8. pthread_attr_setdetachstate() defined. Otherwise, on normal unixes,
  9. threads are created detached in the first place.
  10. This was broken in 0f01bf267680244ec488adaf65a42838756ed48e so that
  11. we started calling pthread_detach() for already detached threads.
  12. Intention was to detach aria checkpoint thread.
  13. However in 87007dc2f71634cc460271eb277ad851ec69c04b aria service threads
  14. were made joinable with appropriate handling, which makes breaking
  15. revision unneccessary.
  16. Revert remnants of 0f01bf267680244ec488adaf65a42838756ed48e, so that
  17. pthread_detach_this_thread() is meaningful only on some ancient unixes
  18. again.
  19. ---
  20. include/my_pthread.h | 2 +-
  21. 1 file changed, 1 insertion(+), 1 deletion(-)
  22. diff --git a/include/my_pthread.h b/include/my_pthread.h
  23. index 6b830ca36d24..ae2f912f979b 100644
  24. --- a/include/my_pthread.h
  25. +++ b/include/my_pthread.h
  26. @@ -184,7 +184,7 @@ int pthread_cancel(pthread_t thread);
  27. #define pthread_key(T,V) pthread_key_t V
  28. #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
  29. #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
  30. -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
  31. +#define pthread_detach_this_thread()
  32. #define pthread_handler_t EXTERNC void *
  33. typedef void *(* pthread_handler)(void *);