File 0859-Remove-possibility-to-disable-async-thread-pool.patch of Package erlang

From 82c3f9a5b91f22697d7f30dad2eed20aeca34bb8 Mon Sep 17 00:00:00 2001
From: Rickard Green <rickard@erlang.org>
Date: Wed, 19 Feb 2020 00:21:27 +0100
Subject: [PATCH] Remove possibility to disable async thread pool

---
 erts/doc/src/erl.xml          | 6 ++----
 erts/emulator/beam/erl_init.c | 5 ++++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml
index 4923aa401a..002c6cada8 100644
--- a/erts/doc/src/erl.xml
+++ b/erts/doc/src/erl.xml
@@ -586,7 +586,7 @@
       <tag><marker id="async_thread_pool_size"/><c><![CDATA[+A size]]></c></tag>
       <item>
         <p>Sets the number of threads in async thread pool. Valid range
-          is 0-1024. Defaults to 10 if thread support is available.</p>
+          is 1-1024. Defaults to 10 if thread support is available.</p>
       </item>
       <tag><c><![CDATA[+B [c | d | i]]]></c></tag>
       <item>
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index bd4a7ab637..13e0d20494 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -549,7 +549,7 @@ void erts_usage(void)
 		 ERTS_ASYNC_THREAD_MIN_STACK_SIZE,
 		 ERTS_ASYNC_THREAD_MAX_STACK_SIZE);
     erts_fprintf(stderr, "-A number      set number of threads in async thread pool,\n");
-    erts_fprintf(stderr, "               valid range is [0-%d]\n",
+    erts_fprintf(stderr, "               valid range is [1-%d]\n",
 		 ERTS_MAX_NO_OF_ASYNC_THREADS);
 
     erts_fprintf(stderr, "-B[c|d|i]      c to have Ctrl-c interrupt the Erlang shell,\n");
@@ -1093,6 +1093,9 @@ early_init(int *argc, char **argv) /*
 	    i++;
 	}
 
+        if (erts_async_max_threads < 1)
+            erts_async_max_threads = 1;
+
 #ifdef ERTS_SMP
 	/* apply any scheduler percentages */
 	if (schdlrs_percentage != 100 || schdlrs_onln_percentage != 100) {
-- 
2.16.4

openSUSE Build Service is sponsored by