diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-03-02 18:30:34 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-03-02 18:30:34 +0300 |
commit | fddde539c9cde818857f46c24eaa7d4e57eb9b44 (patch) | |
tree | 3a4c1b94e97a178f96c0e28a38f76106d2969879 /src/nxt_thread.h | |
parent | d0591f07d7681a66197ee9ea4104177f13ccf8df (diff) | |
download | unit-fddde539c9cde818857f46c24eaa7d4e57eb9b44.tar.gz unit-fddde539c9cde818857f46c24eaa7d4e57eb9b44.tar.bz2 |
Fixing NetBSD compatibility.
Instead of PTHREAD_STACK_MIN define, NetBSD requires to get minimum stack
size using sysctl(_SC_THREAD_STACK_MIN).
This change originally proposed by Juraj Lutter <juraj@lutter.sk>.
Diffstat (limited to 'src/nxt_thread.h')
-rw-r--r-- | src/nxt_thread.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nxt_thread.h b/src/nxt_thread.h index 2ebc331d..d7800cc6 100644 --- a/src/nxt_thread.h +++ b/src/nxt_thread.h @@ -142,6 +142,14 @@ nxt_thread_yield() \ #endif +#if (PTHREAD_STACK_MIN) +#define NXT_THREAD_STACK_MIN PTHREAD_STACK_MIN + +#else +#define NXT_THREAD_STACK_MIN sysconf(_SC_THREAD_STACK_MIN) +#endif + + struct nxt_thread_s { nxt_log_t *log; nxt_log_t main_log; |