mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-09-29 04:25:57 -04:00
hack to make thread.c compile on android: disable signal handling
This commit is contained in:
parent
b182f8df1b
commit
96d0a35f5b
@ -221,9 +221,10 @@ void thread_shutdown(void)
|
|||||||
static void _block_signals(void)
|
static void _block_signals(void)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifndef DISABLE_PTHREAD_BLA
|
||||||
sigset_t ss;
|
sigset_t ss;
|
||||||
|
|
||||||
sigfillset(&ss);
|
//sigfillset(&ss);
|
||||||
|
|
||||||
/* These ones we want */
|
/* These ones we want */
|
||||||
sigdelset(&ss, SIGKILL);
|
sigdelset(&ss, SIGKILL);
|
||||||
@ -237,6 +238,7 @@ static void _block_signals(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -247,6 +249,7 @@ static void _block_signals(void)
|
|||||||
static void _catch_signals(void)
|
static void _catch_signals(void)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifndef DISABLE_PTHREAD_BLA
|
||||||
sigset_t ss;
|
sigset_t ss;
|
||||||
|
|
||||||
sigemptyset(&ss);
|
sigemptyset(&ss);
|
||||||
@ -264,6 +267,7 @@ static void _catch_signals(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -299,7 +303,11 @@ thread_type *thread_create_c(char *name, void *(*start_routine)(void *),
|
|||||||
start->thread = thread;
|
start->thread = thread;
|
||||||
|
|
||||||
pthread_attr_setstacksize (&attr, 512*1024);
|
pthread_attr_setstacksize (&attr, 512*1024);
|
||||||
|
|
||||||
|
#ifndef DISABLE_PTHREAD_BLA
|
||||||
pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED);
|
pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (detached)
|
if (detached)
|
||||||
{
|
{
|
||||||
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
|
||||||
@ -656,7 +664,10 @@ static void *_start_routine(void *arg)
|
|||||||
LOG_INFO4("Added thread %d [%s] started at [%s:%d]", thread->thread_id, thread->name, thread->file, thread->line);
|
LOG_INFO4("Added thread %d [%s] started at [%s:%d]", thread->thread_id, thread->name, thread->file, thread->line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef DISABLE_PTHREAD_BLA
|
||||||
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
|
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
free (start);
|
free (start);
|
||||||
|
|
||||||
(start_routine)(real_arg);
|
(start_routine)(real_arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user