Exemplo n.º 1
0
        public ElaUnit Sync(ElaFunction fun)
        {
            lock (syncRoot)
                fun.Call();

            return(ElaUnit.Instance);
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
 private void Initialize(AsyncModule mod, ElaFunction fun)
 {
     Thread = new ST.Thread(() => Return = fun.Call());
     mod.Threads.Add(Thread);
 }
Exemplo n.º 4
0
        public ElaUnit Sync(ElaFunction fun)
        {
            lock (syncRoot)
                fun.Call();

            return ElaUnit.Instance;
        }
Exemplo n.º 5
0
 private void Initialize(AsyncModule mod, ElaFunction fun)
 {
     Thread = new ST.Thread(() => Return = fun.Call());
     mod.Threads.Add(Thread);
 }