summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql/my_pthread.c
diff options
context:
space:
mode:
authorMySQL Team <mysql@php.net>2000-08-22 09:02:46 +0000
committerMySQL Team <mysql@php.net>2000-08-22 09:02:46 +0000
commit4b1380e31c0f6e76c629611c7ba8c4e2e961a2fd (patch)
tree853d1881366287956bbfa7edf2f4edc0ae62637e /ext/mysql/libmysql/my_pthread.c
parentbac08af4cb97ea7e9db18a4267fb070264792f2f (diff)
downloadphp-git-4b1380e31c0f6e76c629611c7ba8c4e2e961a2fd.tar.gz
New files for MySQL 3.23.23 client library. New files are for qouting
using different character sets.
Diffstat (limited to 'ext/mysql/libmysql/my_pthread.c')
-rw-r--r--ext/mysql/libmysql/my_pthread.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/ext/mysql/libmysql/my_pthread.c b/ext/mysql/libmysql/my_pthread.c
index 2110437a16..b2445bfa36 100644
--- a/ext/mysql/libmysql/my_pthread.c
+++ b/ext/mysql/libmysql/my_pthread.c
@@ -1,5 +1,19 @@
-/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* 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 */
/* Functions to get threads more portable */
@@ -9,7 +23,7 @@
#include <m_string.h>
#include <thr_alarm.h>
#include <assert.h>
-#if !defined(MSDOS) && !defined(__WIN32__)
+#if !defined(MSDOS) && !defined(__WIN__)
#include <netdb.h>
#endif
@@ -86,7 +100,7 @@ int my_pthread_create_detached=1;
#if defined(HAVE_NONPOSIX_SIGWAIT) || defined(HAVE_DEC_3_2_THREADS)
-int my_sigwait(sigset_t *set,int *sig)
+int my_sigwait(const sigset_t *set,int *sig)
{
int signal=sigwait(set);
if (signal < 0)
@@ -107,7 +121,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res)
struct tm *tmp;
pthread_mutex_lock(&LOCK_localtime_r);
tmp=localtime(clock);
- memcpy(res,tmp,sizeof(*tmp));
+ *res= *tmp;
pthread_mutex_unlock(&LOCK_localtime_r);
return res;
}
@@ -131,7 +145,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(__WIN32__) && !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(__WIN__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS)
#if !defined(DONT_USE_SIGSUSPEND)
@@ -151,7 +165,7 @@ void sigwait_setup(sigset_t *set)
sact.sa_flags = 0;
sact.sa_handler = px_handle_sig;
- memcpy(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&unblock_mask);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set);
@@ -177,7 +191,7 @@ void sigwait_setup(sigset_t *set)
}
}
}
- memcpy(&sigwait_set,set,sizeof(*set));
+ memcpy_fixed(&sigwait_set,set,sizeof(*set));
pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0);
pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0);
}
@@ -267,7 +281,7 @@ void *sigwait_thread(void *set_arg)
struct sigaction sact;
sact.sa_flags = 0;
sact.sa_handler = sigwait_handle_sig;
- memcpy(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&pending_set);
for (i = 1; i <= sizeof(pending_set)*8; i++)
@@ -306,7 +320,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_SYSTEM);
+ pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&thr_attr,8196);
my_pthread_attr_setprio(&thr_attr,100); /* Very high priority */