Browse Source

Run the thread init and cleanup in the main thread

The subsystem 'subsystems_thread_init' and 'subsystems_thread_cleanup'
functions are now run in the main thread.
Steven Engler 4 years ago
parent
commit
3ca0dfcc7c
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src/app/main/main.c
  2. 1 0
      src/app/main/shutdown.c

+ 1 - 0
src/app/main/main.c

@@ -1274,6 +1274,7 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
 #endif
 
   subsystems_init();
+  subsystems_thread_init();
 
   init_protocol_warning_severity_level();
 

+ 1 - 0
src/app/main/shutdown.c

@@ -158,6 +158,7 @@ tor_free_all(int postfork)
     release_lockfile();
   }
 
+  subsystems_thread_cleanup();
   subsystems_shutdown();
 
   /* Stuff in util.c and address.c*/