Summary

Provides utilities for working with threads, particularly for identifying and asserting code is running on the main thread.

Static Properties

CurrentThreadId Gets the current thread's managed thread ID.
CurrentThreadName Gets the current thread's name, or null if unnamed.
IsMainThread Returns true if currently executing on the main thread.

Static Methods

AssertIsMainThread Throws an exception if not called from the main thread. Useful for enforcing thread safety on main-thread-only APIs.
AssertIsNotMainThread Throws an exception if called from the main thread. Useful for enforcing that blocking operations don't run on the main thread.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.