1 | static new TreeMap<S, Class> hotwireCached_cache; |
2 | static Lock hotwireCached_lock = lock(); |
3 | |
4 | static Class hotwireCached(S programID) { |
5 | ret hotwireCached(programID, true); |
6 | } |
7 | |
8 | static Class hotwireCached(S programID, bool runMain) { |
9 | ret hotwireCached(programID, runMain, false); |
10 | } |
11 | |
12 | static Class hotwireCached(S programID, bool runMain, bool dependent) { |
13 | lock hotwireCached_lock; |
14 | |
15 | programID = formatSnippetID(programID); |
16 | Class c = hotwireCached_cache.get(programID); |
17 | if (c == null) { |
18 | c = hotwire(programID); |
19 | if (dependent) |
20 | makeDependent(c); |
21 | if (runMain) |
22 | callMain(c); |
23 | hotwireCached_cache.put(programID, c); |
24 | } |
25 | ret c; |
26 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1002224 |
Snippet name: | hotwireCached - hotwire with cached classes - calls main once per class |
Eternal ID of this version: | #1002224/3 |
Text MD5: | e31a0283971a87238d8dd435ec3b2afb |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-19 23:34:38 |
Source code size: | 682 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 679 / 1218 |
Version history: | 2 change(s) |
Referenced in: | [show references] |