prosody
changeset 8685 151ecd18d624
parent 8638 47e3b8b6f17a
child 8717 e1c4bdb2cd25
--- a/prosody	Fri Mar 23 14:02:33 2018 +0000
+++ b/prosody	Fri Mar 23 14:18:27 2018 +0000
@@ -50,8 +50,13 @@
 end
 
 local startup = require "util.startup";
+local async = require "util.async";
 
-startup.prosody();
+-- Note: it's important that this thread is not GC'd, as some C libraries
+-- that are initialized here store a pointer to it ( :/ ).
+local thread = async.runner();
+
+thread:run(startup.prosody);
 
 local function loop()
 	-- Error handler for errors that make it this far
@@ -88,4 +93,4 @@
 prosody.events.fire_event("server-stopped");
 log("info", "Shutdown complete");
 
-os.exit(prosody.shutdown_code)
+os.exit(prosody.shutdown_code);