Esempio n. 1
0
        void RunAnotherThread(CancellationToken cancellationToken)
        {
            Task.Run(() =>
            {
                _AnotherThreadID = Thread.CurrentThread.ManagedThreadId;

                while (true)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    _AzureKinectSensor.ProcessCameraFrame();

                    // Multithread
                    // Debug.Log("MainThreadID: " + _MainThreadID);
                    // Debug.Log("AnotherThreadID: " + _AnotherThreadID);
                }
            });
        }
Esempio n. 2
0
        private void RunAnotherThread(CancellationToken cancellationToken, AzureKinectSensor kinectSensor)
        {
            Task.Run(() =>
            {
                // Multithread
                // Debug.Log("********************");
                // Debug.Log(" MainThreadID: " + _MainThreadID);
                // Debug.Log(" AnotherThreadID: " + Thread.CurrentThread.ManagedThreadId);
                // Debug.Log(" KinectSerialNum: " + kinectSensor.Device.SerialNum);
                // Debug.Log("********************");

                while (true)
                {
                    cancellationToken.ThrowIfCancellationRequested();
                    kinectSensor.ProcessCameraFrame();
                }
            });
        }