static new HashSet fillVar_set; // make: func -> var type; or a class // TODO: better synchronisation // also, might return null while var is filled by another thread static O fillVar(S var, O make) { synchronized(fillVar_set) { if (fillVar_set.contains(var)) ret get(mc(), var); fillVar_set.add(var); } O o = make instanceof Class ? nuInstance((Class) make) : callF(make); set(mc(), var, o); synchronized(fillVar_set) {} // sync? ret o; }