]> mj.ucw.cz Git - libucw.git/commitdiff
Configure default thread stack size globally.
authorMartin Mares <mj@ucw.cz>
Sat, 9 Dec 2006 21:10:45 +0000 (22:10 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 9 Dec 2006 21:10:45 +0000 (22:10 +0100)
lib/Makefile
lib/threads-conf.c [new file with mode: 0644]
lib/threads.h

index d75761a5518da2b8eba16de7faf90df13fff965e..be93256d1ec7ccdfc384836eb6414fbe41498dfe 100644 (file)
@@ -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 (file)
index 0000000..f3ac5a2
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *     The UCW Library -- Threading Helpers
+ *
+ *     (c) 2006 Martin Mares <mj@ucw.cz>
+ *
+ *     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);
+}
index 70534ebbfc265678802c3acba6226f76aa7c3036..355902d668a06fd533b8b8dcd94f6aadaa564ea8 100644 (file)
@@ -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