summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/require/fiber.lua
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts/lua/require/fiber.lua')
-rw-r--r--indra/newview/scripts/lua/require/fiber.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/require/fiber.lua b/indra/newview/scripts/lua/require/fiber.lua
index cae27b936b..b3c684dd67 100644
--- a/indra/newview/scripts/lua/require/fiber.lua
+++ b/indra/newview/scripts/lua/require/fiber.lua
@@ -337,4 +337,10 @@ function fiber.run()
return idle_done
end
+-- Make sure we finish up with a call to run(). That allows a consuming script
+-- to kick off some number of fibers, do some work on the main thread and then
+-- fall off the end of the script without explicitly calling fiber.run().
+-- run() ensures the rest of the fibers run to completion (or error).
+LL.atexit(fiber.run)
+
return fiber