• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines
6 
7 import kotlin.coroutines.*
8 
9 /**
10  * Runs a new coroutine and **blocks** the current thread until its completion.
11  * This function should not be used from a coroutine. It is designed to bridge regular blocking code
12  * to libraries that are written in suspending style, to be used in `main` functions and in tests.
13  */
runBlockingnull14 public expect fun <T> runBlocking(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> T): T