From: Martin Mares Date: Sat, 9 Dec 2006 21:10:45 +0000 (+0100) Subject: Configure default thread stack size globally. X-Git-Tag: holmes-import~506^2~13^2~202 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=1b6962813dfd442167a04baa8ce260b822a9d18d;p=libucw.git Configure default thread stack size globally. --- diff --git a/lib/Makefile b/lib/Makefile index d75761a5..be93256d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -58,7 +58,7 @@ LIBUCW_INCLUDES= \ ifdef CONFIG_UCW_THREADS # Some modules require threading LIBS+=-lpthread -LIBUCW_MODS+=workqueue asio fb-direct +LIBUCW_MODS+=threads-conf workqueue asio fb-direct LIBUCW_INCLUDES+=workqueue.h asio.h endif diff --git a/lib/threads-conf.c b/lib/threads-conf.c new file mode 100644 index 00000000..f3ac5a2f --- /dev/null +++ b/lib/threads-conf.c @@ -0,0 +1,27 @@ +/* + * The UCW Library -- Threading Helpers + * + * (c) 2006 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. + */ + +#include "lib/lib.h" +#include "lib/threads.h" +#include "lib/conf.h" + +uns default_thread_stack_size = 65556; + +static struct cf_section threads_config = { + CF_ITEMS { + CF_UNS("DefaultStackSize", &default_thread_stack_size), + CF_END + } +}; + +static void CONSTRUCTOR +ucwlib_threads_conf_init(void) +{ + cf_declare_section("Threads", &threads_config, 0); +} diff --git a/lib/threads.h b/lib/threads.h index 70534ebb..355902d6 100644 --- a/lib/threads.h +++ b/lib/threads.h @@ -24,4 +24,10 @@ struct ucwlib_context *ucwlib_thread_context(void); void ucwlib_lock(void); void ucwlib_unlock(void); +#ifdef CONFIG_UCW_THREADS + +extern uns default_thread_stack_size; + +#endif + #endif