runInsideInjectedCode

inline fun <R> runInsideInjectedCode(block: () -> R): R?

Executes a given block of code within an injected code under condition that analysis is enabled. This method is used to account for the situation when the Main thread is finished and it wants to logically "finish" all other threads which still record some events.

NOTE: there are other overloads that have different return values. They are useful for some sun.nio.ch.lincheck.EventTracker methods, which do not have return values or require a non-null result.

Return

result of the block invocation or null if the analysis is disabled for the current thread.

Parameters

block

the code to execute within the injected code.


inline fun runInsideInjectedCode(block: () -> Unit)
inline fun <R> runInsideInjectedCode(default: R, block: () -> R): R