Mercurial Hosting > luan
comparison src/luan/modules/ThreadLuan.java @ 1159:3ef883468fd0
remove Http.per_session_pages
fix clone closure bug
replace Thread.global with Thread.global_callable()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 05 Feb 2018 12:37:59 -0700 |
parents | 50879022f49d |
children | 7ef40e1923b7 |
comparison
equal
deleted
inserted
replaced
1158:267fdf5e9fbd | 1159:3ef883468fd0 |
---|---|
70 }}; | 70 }}; |
71 luan.registry().put(c,c); // prevent gc | 71 luan.registry().put(c,c); // prevent gc |
72 luan.onClose(c); | 72 luan.onClose(c); |
73 } | 73 } |
74 | 74 |
75 | 75 /* |
76 public static class GlobalMap { | 76 public static class GlobalMap { |
77 | 77 |
78 private static class Value { | 78 private static class Value { |
79 final long time = System.currentTimeMillis(); | 79 final long time = System.currentTimeMillis(); |
80 final Object v; | 80 final Object v; |
106 val = map.put(key,new Value(v)); | 106 val = map.put(key,new Value(v)); |
107 } | 107 } |
108 return val==null ? null : val.v; | 108 return val==null ? null : val.v; |
109 } | 109 } |
110 } | 110 } |
111 | 111 */ |
112 | 112 |
113 public static void sleep(long millis) throws InterruptedException { | 113 public static void sleep(long millis) throws InterruptedException { |
114 Thread.sleep(millis); | 114 Thread.sleep(millis); |
115 } | 115 } |
116 | 116 |
117 | 117 |
118 /* | |
119 private static boolean isPrimitive(Object v) { | 118 private static boolean isPrimitive(Object v) { |
120 if( v instanceof Object[] ) { | 119 if( v instanceof Object[] ) { |
121 Object[] a = (Object[])v; | 120 Object[] a = (Object[])v; |
122 for( Object obj : a ) { | 121 for( Object obj : a ) { |
123 if( !isPrimitive(obj) ) | 122 if( !isPrimitive(obj) ) |
174 callableMap.put(name,callable); | 173 callableMap.put(name,callable); |
175 } | 174 } |
176 callable.expires = System.currentTimeMillis() + timeout; | 175 callable.expires = System.currentTimeMillis() + timeout; |
177 return callable; | 176 return callable; |
178 } | 177 } |
179 */ | 178 |
179 public static synchronized void removeGlobalCallable(String name) { | |
180 callableMap.remove(name); | |
181 } | |
182 | |
180 } | 183 } |