s4: process_prefork: Make prefork_restart() use an asynchronous timer event instead...
authorJeremy Allison <jra@samba.org>
Thu, 30 Sep 2021 03:49:48 +0000 (20:49 -0700)
committerJeremy Allison <jra@samba.org>
Sat, 2 Oct 2021 01:38:43 +0000 (01:38 +0000)
commit2d87e0f6efa1d8438b26f98d2ad69ffed0af8d0b
tree5b804e0eb36939d250713e289ae796da092fdd48
parentb6d60e8f4d06ca9733a4cc3094312a3dc456a656
s4: process_prefork: Make prefork_restart() use an asynchronous timer event instead of calling sleep(X).

This should prevent any long pauses in the calling process, as we get a callback
for the restart after X seconds. To make the code flow more understandable,
always go through a timer event even if the wait time is zero. This
has the same effect as an immediate event as it will call the callback
function as soon as we go back into the event loop.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct  2 01:38:43 UTC 2021 on sn-devel-184
source4/samba/process_prefork.c