ThreadUtils

Thread assertion utilities.

Types

Link copied to clipboard
annotation class MainThreadOverride

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val OVERRIDE_DISABLED: Int = 0
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The test bypass used to cover the whole of an end-to-end run, which hid main-thread violations that crash in production, such as reading a Ref value during background layout. It is now scoped to the two callers that cannot satisfy the assertion: runs with no real main Looper (see hasRealMainLooper), and instrumentation test bodies, which drive Litho from the runner's own thread (see isInstrumentationThread).

Link copied to clipboard
fun tryRaiseThreadPriority(threadId: Int, targetThreadPriority: Int): Pair<Int, Int>

Try to raise the priority of {@param threadId} to {@param targetThreadPriority}.