Example #1
0
        // Allocates a work unit for the given enumerator.
        private AsyncWorkUnit AllocUnit(IEnumerator inEnumerator, AsyncFlags inFlags)
        {
            AsyncWorkUnit unit = AllocUnitImpl();

            #if DEVELOPMENT
            string name = Fiber.GetTypeName(inEnumerator.GetType());
            #else
            string name = "[not used]";
            #endif // DEVELOPMENT
            unit.Initialize(null, inEnumerator, inFlags, name);
            return(unit);
        }
Example #2
0
        // Allocates a work unit for the given action.
        private AsyncWorkUnit AllocUnit(Action inAction, AsyncFlags inFlags)
        {
            AsyncWorkUnit unit = AllocUnitImpl();

            #if DEVELOPMENT
            string name = string.Format("{0}->{1}::{2}", inAction.Target, inAction.Method.DeclaringType.FullName, inAction.Method.Name);
            #else
            string name = "[not used]";
            #endif // DEVELOPMENT
            unit.Initialize(inAction, null, inFlags, name);
            return(unit);
        }