Skip to content

Commit 3d6557d

Browse files
author
Joachim Gabler
committed
BF: CS-1176 Installation on xlx-amd64 fails due to core of qping
1 parent 92e21d3 commit 3d6557d

File tree

3 files changed

+32
-38
lines changed

3 files changed

+32
-38
lines changed

cmake/ArchitectureSpecificSettings.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function(architecture_specific_settings)
6969

7070
add_compile_definitions(LINUX _GNU_SOURCE GETHOSTBYNAME_R6 GETHOSTBYADDR_R8 HAS_IN_PORT_T SPOOLING_dynamic __SGE_COMPILE_WITH_GETTEXT__)
7171
add_compile_options(-fPIC)
72+
add_compile_options(-pthread)
7273
add_link_options(-pthread -rdynamic)
7374

7475
set(TIRPC_INCLUDES /usr/include/tirpc PARENT_SCOPE)
@@ -107,6 +108,7 @@ function(architecture_specific_settings)
107108
endif ()
108109
add_compile_definitions(LINUX _GNU_SOURCE GETHOSTBYNAME_R6 GETHOSTBYADDR_R8
109110
HAS_IN_PORT_T SPOOLING_dynamic __SGE_COMPILE_WITH_GETTEXT__)
111+
add_compile_options(-pthread)
110112
add_link_options(-pthread -rdynamic)
111113

112114
set(WITH_MTMALLOC OFF PARENT_SCOPE)
@@ -169,6 +171,7 @@ function(architecture_specific_settings)
169171
# can't build jemalloc on CentOS 6 - autoconf is too old
170172
if (SGE_ARCH STREQUAL "xlx-amd64")
171173
set(WITH_JEMALLOC OFF PARENT_SCOPE)
174+
add_compile_definitions(XLINUXAMD64)
172175
# we need to use a self-compiled gcc/g++/libstdc++ on this platform
173176
# as the OS packages (CentOS-6) are too old
174177
# link statically to make sure that the correct libstdc++ is used

doc/markdown/manual/release-notes/02_os_matrix.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ xxQS_NAMExx components on the other axis.
2626
| | | | | | |
2727
| Alma Linux | 8 | x86-64 | x | x | x |
2828
| Alma Linux | 9 | x86-64 | x | x | x |
29-
| CentOS Linux | 6 | x86-64 | a | a | a |
29+
| CentOS Linux | 6 | x86-64 | | d | d |
3030
| CentOS Linux | 7 | x86-64 | a | x | x |
3131
| CentOS Linux | 8 | x86-64 | x | x | x |
3232
| CentOS Linux | 9 | x86-64 | x | x | x |
@@ -48,6 +48,7 @@ xxQS_NAMExx components on the other axis.
4848
-: Unsupported
4949
a: Available but not covered by support contract. Contact our sales and support team if you need this configuration.
5050
b: Still in beta testing. Contact our sales and support team if you need this configuration.
51+
d: Deprecated. Will be removed in the next minor release (9.1.0).
5152
x: Supported
5253

5354
> **Note**

source/libs/comm/lists/cl_thread.cc

+27-37
Original file line numberDiff line numberDiff line change
@@ -599,55 +599,45 @@ int cl_thread_trigger_event(cl_thread_settings_t *thread_config) {
599599
}
600600

601601
int cl_thread_func_testcancel(cl_thread_settings_t *thread_config) {
602-
int ret_val = 0;
603-
int execute_pop = 0;
604-
605602
if (thread_config == nullptr) {
606603
return CL_RETVAL_THREAD_CANCELSTATE_ERROR;
607604
}
608605

609-
/* pthread_cleanup_push() and pthread_cleanup_pop() must be used in the
610-
same { ... } context */
611-
612606
#ifdef CL_DO_COMMLIB_DEBUG
613-
gettimeofday(&(thread_config->thread_last_cancel_test_time),nullptr);
607+
gettimeofday(&(thread_config->thread_last_cancel_test_time), nullptr);
614608
#endif
615609

616-
if (thread_config->thread_cleanup_func != nullptr) {
617-
/* push user cleanup function */
618-
pthread_cleanup_push((void (*)(void *)) thread_config->thread_cleanup_func, thread_config) ;
619-
620-
/* push default cleanup function */
621-
pthread_cleanup_push((void (*)(void *)) cl_thread_default_cleanup_function, thread_config) ;
622-
623-
ret_val = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
610+
// pthread_cleanup_push() and pthread_cleanup_pop() must be used in the same { ... } context
624611

625-
if (ret_val == 0) {
626-
pthread_testcancel();
627-
ret_val = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
628-
}
629-
/* remove cleanup function from stack without execution */
630-
pthread_cleanup_pop(execute_pop); /* client_thread_cleanup */
631-
632-
/* remove user function from stack without execution */
612+
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
613+
if (thread_config->thread_cleanup_func != nullptr) {
614+
#if not defined(XLINUXAMD64)
615+
constexpr int execute_pop = 0;
616+
// push user cleanup function
617+
pthread_cleanup_push(reinterpret_cast<void (*)(void *)>(thread_config->thread_cleanup_func), thread_config) ;
618+
// push default cleanup function
619+
pthread_cleanup_push(reinterpret_cast<void (*)(void *)>(cl_thread_default_cleanup_function), thread_config) ;
620+
#endif
621+
// check if the thread was cancelled - if yes, pthread_testcancel() will not return
622+
pthread_testcancel();
623+
#if not defined(XLINUXAMD64)
633624
pthread_cleanup_pop(execute_pop);
625+
pthread_cleanup_pop(execute_pop);
626+
#endif
634627
} else {
635-
/* push default cleanup function */
636-
pthread_cleanup_push((void (*)(void *)) cl_thread_default_cleanup_function, thread_config) ;
637-
ret_val = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
638-
639-
if (ret_val == 0) {
640-
pthread_testcancel();
641-
ret_val = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
642-
}
643-
/* remove cleanup function from stack without execution */
644-
pthread_cleanup_pop(execute_pop); /* client_thread_cleanup */
628+
#if not defined(XLINUXAMD64)
629+
constexpr int execute_pop = 0;
630+
// push default cleanup function
631+
pthread_cleanup_push(reinterpret_cast<void (*)(void *)>(cl_thread_default_cleanup_function), thread_config) ;
632+
#endif
633+
// check if the thread was cancelled - if yes, pthread_testcancel() will not return
634+
pthread_testcancel();
635+
#if not defined(XLINUXAMD64)
636+
pthread_cleanup_pop(execute_pop);
637+
#endif
645638
}
639+
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
646640

647-
648-
if (ret_val != 0) {
649-
return CL_RETVAL_THREAD_CANCELSTATE_ERROR;
650-
}
651641
return CL_RETVAL_OK;
652642
}
653643

0 commit comments

Comments
 (0)