static new TreeMap<S, Class> hotwireCached_cache;
static Lock hotwireCached_lock = lock();
static Class hotwireCached(S programID) {
ret hotwireCached(programID, true);
}
static Class hotwireCached(S programID, bool runMain) {
ret hotwireCached(programID, runMain, false);
}
static Class hotwireCached(S programID, bool runMain, bool dependent) {
lock hotwireCached_lock;
programID = formatSnippetID(programID);
Class c = hotwireCached_cache.get(programID);
if (c == null) {
c = hotwire(programID);
if (dependent)
makeDependent(c);
if (runMain)
callMain(c);
hotwireCached_cache.put(programID, c);
}
ret c;
}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: | 1185 / 1710 |
| Version history: | 2 change(s) |
| Referenced in: | #1002427 - Accellerating 629 (SPIKE) #1005353 - hotwireOnce - like hotwireCached, but don't run main #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1013033 - hotwireCached_clear - clear all cached classes #3000382 - Answer for ferdie (>> t = 1, f = 0) |