public ElaUnit Sync(ElaFunction fun) { lock (syncRoot) fun.Call(); return(ElaUnit.Instance); }
public string ReadLines(ElaFunction fun, string file) { using (var sr = File.OpenText(file)) { var line = String.Empty; var sb = new StringBuilder(); while ((line = sr.ReadLine()) != null) sb.AppendLine((String)fun.Call(new ElaValue(line)).AsObject()); return sb.ToString(); } }
private void Initialize(AsyncModule mod, ElaFunction fun) { Thread = new ST.Thread(() => Return = fun.Call()); mod.Threads.Add(Thread); }
public ElaUnit Sync(ElaFunction fun) { lock (syncRoot) fun.Call(); return ElaUnit.Instance; }