diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index 79653b1..96b422b 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -118,7 +118,7 @@ defmodule HTTPd do
end
}
- def enable_threads = true
+ def thread_count = 1
def server = fn (host, port) {
def socket = Socket.listen(host, port)
@@ -126,10 +126,11 @@ defmodule HTTPd do
daemonize()
puts("KC3 HTTPd: listening on #{host}:#{port}")
load_app()
- if enable_threads do
- threads = List.map(List.count(8), fn (x) {
+ if thread_count > 1 do
+ threads = List.map(List.count(thread_count - 1), fn (x) {
Thread.new(HTTPd.server_thread)
})
+ HTTPd.server_thread()
List.map(threads, Thread.delete)
else
HTTPd.server_thread()