mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-19 21:22:55 -05:00
- Fix #1176: stack size too small for Alpine Linux.
git-svn-id: file:///svn/unbound/trunk@3959 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
07bbd6c95a
commit
41d174b7f6
2 changed files with 23 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
|||
9 December 2016: Wouter
|
||||
- Fix #1176: stack size too small for Alpine Linux.
|
||||
|
||||
8 December 2016: Wouter
|
||||
- Fix downcast warnings from visual studio in sldns code.
|
||||
- tag 1.6.0rc1
|
||||
|
||||
7 December 2016: Ralph
|
||||
- Add DSA support for OpenSSL 1.1.0
|
||||
|
|
|
|||
21
util/locks.h
21
util/locks.h
|
|
@ -149,8 +149,25 @@ typedef pthread_spinlock_t lock_quick_t;
|
|||
|
||||
/** Thread creation */
|
||||
typedef pthread_t ub_thread_t;
|
||||
/** Pass where to store tread_t in thr. Use default NULL attributes. */
|
||||
#define ub_thread_create(thr, func, arg) LOCKRET(pthread_create(thr, NULL, func, arg))
|
||||
/** On alpine linux default thread stack size is 80 Kb. See
|
||||
http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Thread_stack_size
|
||||
This is not enough and cause segfault. Other linux distros have 2 Mb at least.
|
||||
Wrapper for set up thread stack size */
|
||||
#define PTHREADSTACKSIZE 2*1024*1024
|
||||
#define PTHREADCREATE(thr, stackrequired, func, arg) do {\
|
||||
pthread_attr_t attr; \
|
||||
size_t stacksize; \
|
||||
LOCKRET(pthread_attr_init(&attr)); \
|
||||
LOCKRET(pthread_attr_getstacksize(&attr, &stacksize)); \
|
||||
if (stacksize < stackrequired) { \
|
||||
LOCKRET(pthread_attr_setstacksize(&attr, stackrequired)); \
|
||||
LOCKRET(pthread_create(thr, &attr, func, arg)); \
|
||||
LOCKRET(pthread_attr_getstacksize(&attr, &stacksize)); \
|
||||
verbose(VERB_ALGO, "Thread stack size set to %zu", stacksize); \
|
||||
} else {LOCKRET(pthread_create(thr, NULL, func, arg));} \
|
||||
} while(0)
|
||||
/** Use wrapper for set thread stack size on attributes. */
|
||||
#define ub_thread_create(thr, func, arg) PTHREADCREATE(thr, PTHREADSTACKSIZE, func, arg)
|
||||
/** get self id. */
|
||||
#define ub_thread_self() pthread_self()
|
||||
/** wait for another thread to terminate */
|
||||
|
|
|
|||
Loading…
Reference in a new issue