diff options
| author | Valentin Bartenev <vbart@nginx.com> | 2015-03-14 17:37:07 +0300 |
|---|---|---|
| committer | Valentin Bartenev <vbart@nginx.com> | 2015-03-14 17:37:07 +0300 |
| commit | 305fc021db799c87d751f0f1f5e99afee7bb2b3b (patch) | |
| tree | 8c3cf7a86f08ede19803a9f9beecb33cc0d9ebb3 /auto | |
| parent | 08e05a40422300a25e3b4e5b915592d7b2c41592 (diff) | |
| download | nginx-305fc021db799c87d751f0f1f5e99afee7bb2b3b.tar.gz nginx-305fc021db799c87d751f0f1f5e99afee7bb2b3b.tar.bz2 | |
Thread pools implementation.
Diffstat (limited to 'auto')
| -rwxr-xr-x | auto/configure | 1 | ||||
| -rw-r--r-- | auto/modules | 6 | ||||
| -rw-r--r-- | auto/options | 4 | ||||
| -rw-r--r-- | auto/sources | 7 | ||||
| -rw-r--r-- | auto/summary | 4 | ||||
| -rw-r--r-- | auto/threads | 20 |
6 files changed, 42 insertions, 0 deletions
diff --git a/auto/configure b/auto/configure index e8929b8f0..617d992b8 100755 --- a/auto/configure +++ b/auto/configure @@ -58,6 +58,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then . auto/unix fi +. auto/threads . auto/modules . auto/lib/conf diff --git a/auto/modules b/auto/modules index 788596763..5a56957b8 100644 --- a/auto/modules +++ b/auto/modules @@ -432,6 +432,12 @@ fi modules="$CORE_MODULES $EVENT_MODULES" +# thread pool module should be initialized after events +if [ $USE_THREADS = YES ]; then + modules="$modules $THREAD_POOL_MODULE" +fi + + if [ $USE_OPENSSL = YES ]; then modules="$modules $OPENSSL_MODULE" CORE_DEPS="$CORE_DEPS $OPENSSL_DEPS" diff --git a/auto/options b/auto/options index 02affbdeb..763871f7b 100644 --- a/auto/options +++ b/auto/options @@ -190,6 +190,8 @@ do --without-poll_module) EVENT_POLL=NONE ;; --with-aio_module) EVENT_AIO=YES ;; + --with-threads) USE_THREADS=YES ;; + --with-file-aio) NGX_FILE_AIO=YES ;; --with-ipv6) NGX_IPV6=YES ;; @@ -351,6 +353,8 @@ cat << END --with-poll_module enable poll module --without-poll_module disable poll module + --with-threads enable thread pool support + --with-file-aio enable file AIO support --with-ipv6 enable IPv6 support diff --git a/auto/sources b/auto/sources index 1287782ea..e7f105889 100644 --- a/auto/sources +++ b/auto/sources @@ -193,6 +193,13 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \ POSIX_DEPS=src/os/unix/ngx_posix_config.h +THREAD_POOL_MODULE=ngx_thread_pool_module +THREAD_POOL_DEPS=src/core/ngx_thread_pool.h +THREAD_POOL_SRCS="src/core/ngx_thread_pool.c + src/os/unix/ngx_thread_cond.c + src/os/unix/ngx_thread_mutex.c + src/os/unix/ngx_thread_id.c" + FREEBSD_DEPS="src/os/unix/ngx_freebsd_config.h src/os/unix/ngx_freebsd.h" FREEBSD_SRCS=src/os/unix/ngx_freebsd_init.c FREEBSD_SENDFILE_SRCS=src/os/unix/ngx_freebsd_sendfile_chain.c diff --git a/auto/summary b/auto/summary index b2009062d..1be975d82 100644 --- a/auto/summary +++ b/auto/summary @@ -7,6 +7,10 @@ echo echo "Configuration summary" +if [ $USE_THREADS = YES ]; then + echo " + using threads" +fi + if [ $USE_PCRE = DISABLED ]; then echo " + PCRE library is disabled" diff --git a/auto/threads b/auto/threads new file mode 100644 index 000000000..381f07ac3 --- /dev/null +++ b/auto/threads @@ -0,0 +1,20 @@ + +# Copyright (C) Nginx, Inc. + + +if [ $USE_THREADS = YES ]; then + + if [ "$NGX_PLATFORM" = win32 ]; then + cat << END + +$0: --with-threads is not supported on Windows + +END + exit 1 + fi + + have=NGX_THREADS . auto/have + CORE_DEPS="$CORE_DEPS $THREAD_POOL_DEPS" + CORE_SRCS="$CORE_SRCS $THREAD_POOL_SRCS" + CORE_LIBS="$CORE_LIBS -lpthread" +fi |
