From f70495a48646e54272783b4b709aca0396cb85f8 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 26 Nov 2021 08:19:58 +0100 Subject: Create daemon module and use it from server Need to run setup() after forking, otherwise each TaskRunner created in setup() will dead-lock at exit as there are now two copies of each of them but not of the threads causing the destructors to lock. This made setup a little bit more complicated as it has to forward the log and status to parent process but I turned out quite nice. --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 654a6bf..9f23dfc 100644 --- a/meson.build +++ b/meson.build @@ -69,6 +69,8 @@ common_lib = static_library( 'src/buffer.hh', 'src/common.hh', 'src/config.hh', + 'src/daemon.cc', + 'src/daemon.hh', 'src/date.cc', 'src/date.hh', 'src/hash_method.cc', @@ -334,6 +336,13 @@ test('config', cpp_args: test_cpp_flags, dependencies: [common_dep, config_dep, test_utils_dep])) +test('daemon', + executable( + 'test_daemon', + sources: ['test/test_daemon.cc'], + cpp_args: test_cpp_flags, + dependencies: [common_dep, gmock_dep, gtest_dep])) + test('date', executable( 'test_date', -- cgit v1.2.3-70-g09d2