Mercurial Hosting > luan
comparison src/luan/LuanState.java @ 126:0149bdf98fd8
add ThreadLib
git-svn-id: https://luan-java.googlecode.com/svn/trunk@127 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 06 Jun 2014 14:16:38 +0000 |
parents | f537ff5e511d |
children | f0a4abe58593 |
comparison
equal
deleted
inserted
replaced
125:0cd559a16758 | 126:0149bdf98fd8 |
---|---|
14 import luan.lib.StringLib; | 14 import luan.lib.StringLib; |
15 import luan.lib.TableLib; | 15 import luan.lib.TableLib; |
16 import luan.lib.HtmlLib; | 16 import luan.lib.HtmlLib; |
17 import luan.lib.BinaryLib; | 17 import luan.lib.BinaryLib; |
18 import luan.lib.IoLib; | 18 import luan.lib.IoLib; |
19 import luan.lib.ThreadLib; | |
19 | 20 |
20 | 21 |
21 public abstract class LuanState implements DeepCloneable<LuanState> { | 22 public abstract class LuanState implements DeepCloneable<LuanState> { |
22 public final LuanBit JAVA = bit(LuanElement.JAVA); | 23 public final LuanBit JAVA = bit(LuanElement.JAVA); |
23 | 24 |
38 mtGetters = new ArrayList<MetatableGetter>(); | 39 mtGetters = new ArrayList<MetatableGetter>(); |
39 } | 40 } |
40 | 41 |
41 protected LuanState(LuanState luan) { | 42 protected LuanState(LuanState luan) { |
42 mtGetters = new ArrayList<MetatableGetter>(luan.mtGetters); | 43 mtGetters = new ArrayList<MetatableGetter>(luan.mtGetters); |
43 } | |
44 | |
45 public final LuanState deepClone() { | |
46 return new DeepCloner().deepClone(this); | |
47 } | 44 } |
48 | 45 |
49 @Override public void deepenClone(LuanState clone,DeepCloner cloner) { | 46 @Override public void deepenClone(LuanState clone,DeepCloner cloner) { |
50 clone.global = cloner.deepClone(global); | 47 clone.global = cloner.deepClone(global); |
51 clone.loaded = cloner.deepClone(loaded); | 48 clone.loaded = cloner.deepClone(loaded); |
112 StringLib.load(luan); | 109 StringLib.load(luan); |
113 TableLib.load(luan); | 110 TableLib.load(luan); |
114 HtmlLib.load(luan); | 111 HtmlLib.load(luan); |
115 BinaryLib.load(luan); | 112 BinaryLib.load(luan); |
116 IoLib.load(luan); | 113 IoLib.load(luan); |
114 ThreadLib.load(luan); | |
117 BasicLib.do_java_resource(luan,"luan/lib/init.luan"); | 115 BasicLib.do_java_resource(luan,"luan/lib/init.luan"); |
118 JavaLib.load(luan); | 116 JavaLib.load(luan); |
119 return luan; | 117 return luan; |
120 } catch(LuanException e) { | 118 } catch(LuanException e) { |
121 throw new RuntimeException(e); | 119 throw new RuntimeException(e); |