Mercurial Hosting > luan
diff core/src/luan/modules/ThreadLuan.java @ 301:a6bf8ff720f8
add java security
git-svn-id: https://luan-java.googlecode.com/svn/trunk@302 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 17 Dec 2014 12:35:57 +0000 |
parents | ec016471c6eb |
children | c6bcb8859b93 |
line wrap: on
line diff
--- a/core/src/luan/modules/ThreadLuan.java Tue Dec 16 13:13:33 2014 +0000 +++ b/core/src/luan/modules/ThreadLuan.java Wed Dec 17 12:35:57 2014 +0000 @@ -6,29 +6,11 @@ import luan.LuanState; import luan.LuanFunction; import luan.LuanTable; -import luan.LuanJavaFunction; import luan.LuanException; import luan.DeepCloner; public final class ThreadLuan { - - public static final LuanFunction LOADER = new LuanFunction() { - @Override public Object call(LuanState luan,Object[] args) { - LuanTable module = Luan.newTable(); - try { - add( module, "fork", LuanState.class, LuanFunction.class, new Object[0].getClass() ); - } catch(NoSuchMethodException e) { - throw new RuntimeException(e); - } - return module; - } - }; - - private static void add(LuanTable t,String method,Class<?>... parameterTypes) throws NoSuchMethodException { - t.put( method, new LuanJavaFunction(ThreadLuan.class.getMethod(method,parameterTypes),null) ); - } - private static final Executor exec = Executors.newCachedThreadPool(); public static void fork(LuanState luan,LuanFunction fn,Object... args) { @@ -44,5 +26,4 @@ } }}); } - }