public void ExecuteThreadedWork()
    {
        long i = maxIterations;

        while (--i > -1 && !isAborted)
        {
            //This lightweight method checks if Unity is still active.
            //If your app lozes focus or gets pauzed, it will sleep the thread.
            //If the application quits, it will abort the thread.
            Loom.SleepOrAbortIfUnityInactive();

            if (i == (maxIterations / 2))
            {
                Loom.DispatchToMainThread(() =>
                                          Debug.Log("Dispatch: is this the MainThread? " + Loom.CheckIfMainThread()), true);

                Debug.Log("From WorkerThread: is this the MainThread? " + Loom.CheckIfMainThread());

                GameObject cube = (GameObject)Loom.DispatchToMainThreadReturn(TestThreadSafeDispatch, true);
                Loom.DispatchToMainThread(() => cube.name += "_RenamedFrom: " + Thread.CurrentThread.Name);
            }
            result++;
        }
    }