Run() приватный Метод

Start a transaction and invoke a function.
private Run ( IFn fn ) : object
fn IFn The function to invoke.
Результат object
Пример #1
0
        public static object runInTransaction(IFn fn)
        {
            // TODO: This can be called on something more general than  an IFn.
            // We can could define a delegate for this, probably use ThreadStartDelegate.
            // Should still have a version that takes IFn.
            LockingTransaction t = _transaction;
            Object             ret;

            if (t == null)
            {
                _transaction = t = new LockingTransaction();
                try
                {
                    ret = t.Run(fn);
                }
                finally
                {
                    _transaction = null;
                }
            }
            else
            {
                if (t._info != null)
                {
                    ret = fn.invoke();
                }
                else
                {
                    ret = t.Run(fn);
                }
            }

            return(ret);
        }
        public static object runInTransaction(IFn fn)
        {
            // TODO: This can be called on something more general than  an IFn.
            // We can could define a delegate for this, probably use ThreadStartDelegate.
            // Should still have a version that takes IFn.
            LockingTransaction t = _transaction;
            Object ret;

            if (t == null)
            {
                _transaction = t = new LockingTransaction();
                try
                {
                    ret = t.Run(fn);
                }
                finally
                {
                    _transaction = null;
                }
            }
            else
            {
                if (t._info != null)
                    ret = fn.invoke();
                else
                    ret = t.Run(fn);
            }

            return ret;
        }