changeset 1241:2b5046cd7963

fix Thread safe()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Jun 2018 22:30:13 -0600
parents 354e661dee7f
children ce3279ef1bd9
files src/luan/modules/Thread.luan
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
diff -r 354e661dee7f -r 2b5046cd7963 src/luan/modules/Thread.luan
--- a/src/luan/modules/Thread.luan	Thu Jun 21 21:58:47 2018 -0600
+++ b/src/luan/modules/Thread.luan	Thu Jun 21 22:30:13 2018 -0600
@@ -13,15 +13,13 @@
 Thread.sleep = ThreadLuan.sleep
 
 local function safe(fn)
-	return function()
-		try {
-			function()
-				fn()
-			end
+	return function(...)
+		try( {
+			fn
 			catch = function(e)
 				logger.error(e)
 			end
-		}
+		}, ... )
 	end
 end