HikariThreading.ThreadManager.UnsafeUpdate C# (CSharp) Method

UnsafeUpdate() private method

Checks for new work in the Queue and sends it out, checks for spawning and despawning threads.
private UnsafeUpdate ( ) : void
return void
        internal override void UnsafeUpdate( )
        {
            // Check out nappers and pull any awakened ones to waiting
            UnsafeRequeueAwakenedTasks();

            // Check if any dedicated threads are done. If so, add them to the pool.
            HandleDedicatedThreads();

            // Assign work, and remove napping threads from action.
            UnsafeHandleThreads();

            // Check for despawning and spawning
            // This only checks for a despawn if we didn't spawn.
            lock ( workLock )
            {
                if ( !SpawnThreadIfNeeded() )
                    DespawnThreadIfNeeded();
            }
        }

Usage Example

Example #1
0
 /// <summary>
 /// Unity's update loop. All we need to do is update the managers.
 /// </summary>
 internal void Update( )
 {
     // Maybe the threadManager should be moved to its own thread.
     threadManager.UnsafeUpdate();
     unityManager.UnsafeUpdate();
 }
All Usage Examples Of HikariThreading.ThreadManager::UnsafeUpdate