Mercurial Hosting > luan
comparison core/src/luan/modules/ThreadLuan.java @ 582:31926755689e
add Thread.synchronized
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 31 Jul 2015 06:20:17 -0600 |
parents | 6cc2f047019b |
children | cdc70de628b5 |
comparison
equal
deleted
inserted
replaced
581:5d4652d78ce0 | 582:31926755689e |
---|---|
24 } catch(LuanException e) { | 24 } catch(LuanException e) { |
25 e.printStackTrace(); | 25 e.printStackTrace(); |
26 } | 26 } |
27 }}); | 27 }}); |
28 } | 28 } |
29 | |
30 public static LuanFunction synchronized_(final LuanState luan,final LuanFunction fn) throws LuanException { | |
31 Utils.checkNotNull(luan,fn); | |
32 return new LuanFunction() { | |
33 @Override public Object call(LuanState ingored,Object[] args) throws LuanException { | |
34 synchronized(luan) { | |
35 return fn.call(luan,args); | |
36 } | |
37 } | |
38 }; | |
39 } | |
40 | |
29 } | 41 } |