isMainThread

Returns if the current thread is main thread.

Examples

JobDispatcher.dispatchOnMainThread(Unit) {
assertTrue(isMainThread())
}

JobDispatcher.dispatchOnBackgroundThread(Unit) {
assertFalse(isMainThread())
}

common
fun isMainThread(): Boolean
ios
fun isMainThread(): Boolean