val int = AtomicInteger()
CoroutineScope(Dispatchers.IO).launch {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
Log.e("@@@ CoroutineScope @@@", int.toString())
}
runBlocking {
withContext(Dispatchers.IO) {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
}
Log.e("@@@ withContext @@@", int.toString())
}
runBlocking {
withContext(Dispatchers.IO) {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
}
Log.e("@@@ withContext @@@", int.toString())
}
CoroutineScope(Dispatchers.IO).launch {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
Log.e("@@@ CoroutineScope @@@", int.toString())
}
runBlocking {
withContext(Dispatchers.IO) {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
}
Log.e("@@@ withContext @@@", int.toString())
}
CoroutineScope(Dispatchers.IO).launch {
repeat(100) {
launch {
repeat(100) {
int.incrementAndGet()
}
}
}
Log.e("@@@ CoroutineScope @@@", int.toString())
}
.observe(viewLifecycleOwner, Observer{})
.observe(this, Observer{})
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}