uh_start_worker: Improve
The child process is only created when the number of workers is greater than 1 Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
1 parent
143e0d8abe
commit
c11052e302
1 file changed
+4
-2
+4
-2
@@ -145,8 +145,10 @@ static void uh_start_worker(struct uh_server *srv, int n)
|
||||
if (n < 0)
|
||||
n = get_nprocs();
|
||||
|
||||
if (n > 0)
|
||||
uh_stop_accept(srvi);
|
||||
if (n < 2)
|
||||
return;
|
||||
|
||||
uh_stop_accept(srvi);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
pid = fork();
|
||||
|
||||
Reference in new issue
Block a user