Ejemplo n.º 1
0
        /// <summary>
        /// Queues up post-function with relevant data for execution in WaitForTheadingGroupToFinish()
        /// </summary>
        /// <param name="postFunction">function to be executed using data from completed threadedTask</param>
        /// <param name="parameter">data from completed threadedTask</param>
        /// <param name="group">this function's thread group</param>
        internal void EnqueuePostFunction(Action <object> postFunction, object parameter, KSPTSThreadingGroup group)
        {
            KSPTSParametrizedPostFunction         tmpPostFunc = new KSPTSParametrizedPostFunction(postFunction, parameter);
            Queue <KSPTSParametrizedPostFunction> tmpQueue    = _postFunctions[group];

            lock (locker)
            {
                tmpQueue.Enqueue(tmpPostFunc);
                Monitor.Pulse(locker);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Queues up post-function with relevant data for execution in WaitForTheadingGroupToFinish()
        /// </summary>
        /// <param name="postFunction">function to be executed using data from completed threadedTask</param>
        /// <param name="parameter">data from completed threadedTask</param>
        /// <param name="group">this function's thread group</param>
        internal void EnqueuePostFunction(Action<object> postFunction, object parameter, KSPTSThreadingGroup group)
        {
            KSPTSParametrizedPostFunction tmpPostFunc = new KSPTSParametrizedPostFunction(postFunction, parameter);
            Queue<KSPTSParametrizedPostFunction> tmpQueue = _postFunctions[group];

            lock(locker)
            {
                tmpQueue.Enqueue(tmpPostFunc);
                Monitor.Pulse(locker);
            }
        }