summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql/my_pthread.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-08-22 17:59:35 +0000
committerAndi Gutmans <andi@php.net>2000-08-22 17:59:35 +0000
commit0222b7ab416d845abcd3925b3da47fa2d7ed238d (patch)
tree38cbb73fda38196612fddffda4d803003a86b568 /ext/mysql/libmysql/my_pthread.c
parent60676f19a5f5425c4375d8ba60e8bd07016ba562 (diff)
downloadphp-git-0222b7ab416d845abcd3925b3da47fa2d7ed238d.tar.gz
- Try and revert libmysql for 4.0.2
Diffstat (limited to 'ext/mysql/libmysql/my_pthread.c')
-rw-r--r--ext/mysql/libmysql/my_pthread.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/ext/mysql/libmysql/my_pthread.c b/ext/mysql/libmysql/my_pthread.c
index b2445bfa36..2110437a16 100644
--- a/ext/mysql/libmysql/my_pthread.c
+++ b/ext/mysql/libmysql/my_pthread.c
@@ -1,19 +1,5 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
+/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
+ This file is public domain and comes with NO WARRANTY of any kind */
/* Functions to get threads more portable */
@@ -23,7 +9,7 @@
#include <m_string.h>
#include <thr_alarm.h>
#include <assert.h>
-#if !defined(MSDOS) && !defined(__WIN__)
+#if !defined(MSDOS) && !defined(__WIN32__)
#include <netdb.h>
#endif
@@ -100,7 +86,7 @@ int my_pthread_create_detached=1;
#if defined(HAVE_NONPOSIX_SIGWAIT) || defined(HAVE_DEC_3_2_THREADS)
-int my_sigwait(const sigset_t *set,int *sig)
+int my_sigwait(sigset_t *set,int *sig)
{
int signal=sigwait(set);
if (signal < 0)
@@ -121,7 +107,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res)
struct tm *tmp;
pthread_mutex_lock(&LOCK_localtime_r);
tmp=localtime(clock);
- *res= *tmp;
+ memcpy(res,tmp,sizeof(*tmp));
pthread_mutex_unlock(&LOCK_localtime_r);
return res;
}
@@ -145,7 +131,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res)
** Author: Gary Wisniewski <garyw@spidereye.com.au>, much modified by Monty
****************************************************************************/
-#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS)
+#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(sigwait) && !defined(__WIN32__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS)
#if !defined(DONT_USE_SIGSUSPEND)
@@ -165,7 +151,7 @@ void sigwait_setup(sigset_t *set)
sact.sa_flags = 0;
sact.sa_handler = px_handle_sig;
- memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&unblock_mask);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set);
@@ -191,7 +177,7 @@ void sigwait_setup(sigset_t *set)
}
}
}
- memcpy_fixed(&sigwait_set,set,sizeof(*set));
+ memcpy(&sigwait_set,set,sizeof(*set));
pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0);
pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0);
}
@@ -281,7 +267,7 @@ void *sigwait_thread(void *set_arg)
struct sigaction sact;
sact.sa_flags = 0;
sact.sa_handler = sigwait_handle_sig;
- memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&pending_set);
for (i = 1; i <= sizeof(pending_set)*8; i++)
@@ -320,7 +306,7 @@ int sigwait(sigset_t *setp, int *sigp)
pthread_cond_init(&COND_sigwait,NULL);
pthread_attr_init(&thr_attr);
- pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
+ pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&thr_attr,8196);
my_pthread_attr_setprio(&thr_attr,100); /* Very high priority */