summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-11-25 18:03:05 +0300
committerAlexander Nozdrin <alik@sun.com>2009-11-25 18:03:05 +0300
commit52c66b56710046034fc631df4f3a165ba5a704f7 (patch)
treeb7488b7a2e23cf4b596766c1c84f64235543757a /mysys/my_pthread.c
parent72a26125e21fc4c654a8a1c9c1841f79f62d4d7a (diff)
parentbe0add42f53b23d8a5e279cb3041a3fc93e375a0 (diff)
downloadmariadb-git-52c66b56710046034fc631df4f3a165ba5a704f7.tar.gz
Manual merge/pull from mysql-next-mr.
Conflicts: - sql/sql_insert.cc
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c49
1 files changed, 4 insertions, 45 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index aba3e47d754..fd1798ab203 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -31,46 +31,6 @@
uint thd_lib_detected= 0;
-#ifndef my_pthread_setprio
-void my_pthread_setprio(pthread_t thread_id,int prior)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
- struct sched_param tmp_sched_param;
- bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param));
- tmp_sched_param.sched_priority=prior;
- VOID(pthread_setschedparam(thread_id,SCHED_POLICY,&tmp_sched_param));
-#endif
-}
-#endif
-
-#ifndef my_pthread_getprio
-int my_pthread_getprio(pthread_t thread_id)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
- struct sched_param tmp_sched_param;
- int policy;
- if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param))
- {
- return tmp_sched_param.sched_priority;
- }
-#endif
- return -1;
-}
-#endif
-
-#ifndef my_pthread_attr_setprio
-void my_pthread_attr_setprio(pthread_attr_t *attr, int priority)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
- struct sched_param tmp_sched_param;
- bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param));
- tmp_sched_param.sched_priority=priority;
- VOID(pthread_attr_setschedparam(attr,&tmp_sched_param));
-#endif
-}
-#endif
-
-
/* To allow use of pthread_getspecific with two arguments */
#ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
@@ -308,7 +268,7 @@ void sigwait_handle_sig(int sig)
{
pthread_mutex_lock(&LOCK_sigwait);
sigaddset(&pending_set, sig);
- VOID(pthread_cond_signal(&COND_sigwait)); /* inform sigwait() about signal */
+ pthread_cond_signal(&COND_sigwait); /* inform sigwait() about signal */
pthread_mutex_unlock(&LOCK_sigwait);
}
@@ -364,9 +324,8 @@ int sigwait(sigset_t *setp, int *sigp)
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 */
- VOID(pthread_create(&sigwait_thread_id,&thr_attr,sigwait_thread,setp));
- VOID(pthread_attr_destroy(&thr_attr));
+ pthread_create(&sigwait_thread_id,&thr_attr,sigwait_thread,setp);
+ pthread_attr_destroy(&thr_attr);
}
pthread_mutex_lock(&LOCK_sigwait);
@@ -392,7 +351,7 @@ int sigwait(sigset_t *setp, int *sigp)
return 0;
}
}
- VOID(pthread_cond_wait(&COND_sigwait,&LOCK_sigwait));
+ pthread_cond_wait(&COND_sigwait,&LOCK_sigwait);
}
return 0;
}