Beispiel #1
0
        private static void AsyncUpdateThread(object obj)
        {
        #if !NETFX_CORE && !UNITY_WEBGL
            KeyValuePair <object, int> pair = (KeyValuePair <object, int>)obj;
            WorkerThreadPool           pool = ( WorkerThreadPool )pair.Key;
            int id = ( int )pair.Value;

            while (true)
            {
                try
                {
                    pool.m_threadPoolContinueSignals[id].WaitOne();

                    if (pool.m_threadPoolTerminateSignal.WaitOne(0))
                    {
                        break;
                    }

                    while (true)
                    {
                        AmplifyMotion.MotionState state = null;

                        lock (pool.m_threadStateQueueLocks[id])
                        {
                            if (pool.m_threadStateQueues[id].Count > 0)
                            {
                                state = pool.m_threadStateQueues[id].Dequeue();
                            }
                        }

                        if (state != null)
                        {
                            state.AsyncUpdate();
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                catch (System.Exception e)
                {
                    if (e.GetType() != typeof(ThreadAbortException))
                    {
                        Debug.LogWarning(e);
                    }
                }
            }
        #endif
        }
	private static void AsyncUpdateCallback( object obj )
	{
		AmplifyMotion.MotionState state = ( AmplifyMotion.MotionState ) obj;
		state.AsyncUpdate();
	}