diff options
author | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-01-22 03:33:59 +0200 |
---|---|---|
committer | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-01-22 03:33:59 +0200 |
commit | 077840fa23d65e1eb60fdd601802b151ff4b54b4 (patch) | |
tree | 2c5744d9e9cf04714fcd0fe9214cfb40b2656b74 /include | |
parent | 4fda992bff2034ff551d30cb5da742184ff4a3df (diff) | |
parent | 454c763c6be44b34c8e1ff9b8561ab21e717b742 (diff) | |
download | mariadb-git-077840fa23d65e1eb60fdd601802b151ff4b54b4.tar.gz |
Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.0
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
include/thr_alarm.h:
Auto merged
mysys/my_pthread.c:
Auto merged
BUILD/SETUP.sh:
Merged from 4.0
configure.in:
Merged from 4.0
include/my_global.h:
Merged from 4.0
include/my_pthread.h:
Merged from 4.0
mysys/thr_alarm.c:
Merged from 4.0
sql/mysqld.cc:
Merged from 4.0
BUILD/SETUP.sh.rej:
Merged from 4.0
configure.in.rej:
Merged from 4.0
include/my_global.h.rej:
Merged from 4.0
include/my_pthread.h.rej:
Merged from 4.0
mysys/thr_alarm.c.rej:
Merged from 4.0
sql/mysqld.cc.rej:
Merged from 4.0
Diffstat (limited to 'include')
-rw-r--r-- | include/my_global.h | 7 | ||||
-rw-r--r-- | include/my_global.h.rej | 17 | ||||
-rw-r--r-- | include/my_pthread.h | 8 | ||||
-rw-r--r-- | include/my_pthread.h.rej | 80 | ||||
-rw-r--r-- | include/thr_alarm.h | 5 |
5 files changed, 110 insertions, 7 deletions
diff --git a/include/my_global.h b/include/my_global.h index 2de54e521b5..bd54ba1cf89 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -138,7 +138,7 @@ /* Fix problem with S_ISLNK() on Linux */ -#if defined(TARGET_OS_LINUX) +#if defined(TARGET_OS_LINUX) || defined(__GLIBC__) #undef _GNU_SOURCE #define _GNU_SOURCE 1 #endif @@ -415,7 +415,10 @@ int __void__; #endif /* Define some useful general macros */ -#if !defined(max) +#if defined(__cplusplus) && defined(__GNUC__) +#define max(a, b) ((a) >? (b)) +#define min(a, b) ((a) <? (b)) +#elif !defined(max) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #endif diff --git a/include/my_global.h.rej b/include/my_global.h.rej new file mode 100644 index 00000000000..f2953d169e7 --- /dev/null +++ b/include/my_global.h.rej @@ -0,0 +1,17 @@ +*************** +*** 97,103 **** + + + /* Fix problem with S_ISLNK() on Linux */ +! #if defined(HAVE_LINUXTHREADS) + #undef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif +--- 97,103 ---- + + + /* Fix problem with S_ISLNK() on Linux */ +! #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) + #undef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif diff --git a/include/my_pthread.h b/include/my_pthread.h index 8d03de49574..b852cfaad3d 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -28,6 +28,14 @@ extern "C" { #endif /* __cplusplus */ +/* Thread library */ + +#define THD_LIB_OTHER 1 +#define THD_LIB_NPTL 2 +#define THD_LIB_LT 4 + +extern uint thd_lib_detected; + #if defined(__WIN__) || defined(OS2) #ifdef OS2 diff --git a/include/my_pthread.h.rej b/include/my_pthread.h.rej new file mode 100644 index 00000000000..1f73655b0bd --- /dev/null +++ b/include/my_pthread.h.rej @@ -0,0 +1,80 @@ +*************** +*** 286,293 **** + #undef HAVE_PTHREAD_RWLOCK_RDLOCK + #undef HAVE_SNPRINTF + +! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) +! #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) + #define my_pthread_attr_setprio(A,B) + #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ + +--- 294,301 ---- + #undef HAVE_PTHREAD_RWLOCK_RDLOCK + #undef HAVE_SNPRINTF + +! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) +! #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) + #define my_pthread_attr_setprio(A,B) + #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ + +*************** +*** 324,337 **** + #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) + int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ + #endif +! #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) +! #define sigset(A,B) do { struct sigaction s; sigset_t set; \ +! sigemptyset(&set); \ +! s.sa_handler = (B); \ +! s.sa_mask = set; \ +! s.sa_flags = 0; \ +! sigaction((A), &s, (struct sigaction *) NULL); \ + } while (0) + #endif + + #ifndef my_pthread_setprio +--- 332,358 ---- + #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) + int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ + #endif +! +! /* +! We define my_sigset() and use that instead of the system sigset() so that +! we can favor an implementation based on sigaction(). On some systems, such +! as Mac OS X, sigset() results in flags such as SA_RESTART being set, and +! we want to make sure that no such flags are set. +! */ +! #if defined(HAVE_SIGACTION) && !defined(my_sigset) +! #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ +! DBUG_ASSERT((A) != 0); \ +! sigemptyset(&set); \ +! s.sa_handler = (B); \ +! s.sa_mask = set; \ +! s.sa_flags = 0; \ +! rc= sigaction((A), &s, (struct sigaction *) NULL); \ +! DBUG_ASSERT(rc == 0); \ + } while (0) ++ #elif defined(HAVE_SIGSET) && !defined(my_sigset) ++ #define my_sigset(A,B) sigset((A),(B)) ++ #elif !defined(my_sigset) ++ #define my_sigset(A,B) signal((A),(B)) + #endif + + #ifndef my_pthread_setprio +*************** +*** 416,422 **** + #undef pthread_detach_this_thread + #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } + #undef sigset +! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) + #endif + + #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) +--- 437,443 ---- + #undef pthread_detach_this_thread + #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } + #undef sigset +! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) + #endif + + #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 7a10d6886ce..0c26a67acf4 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -25,11 +25,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif -#ifdef HAVE_LINUXTHREADS -#define THR_CLIENT_ALARM SIGALRM -#else -#define THR_CLIENT_ALARM SIGUSR1 -#endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD |