File tree 3 files changed +5
-5
lines changed
common/kotlinx-coroutines-core-common/src
core/kotlinx-coroutines-core/src
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ public object GlobalScope : CoroutineScope {
163
163
* ... load some UI data ...
164
164
* }
165
165
*
166
- * withContext(UI ) {
166
+ * withContext(Dispatchers.Main ) {
167
167
* doSomeWork()
168
168
* val result = data.await()
169
169
* display(result)
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ public interface SendChannel<in E> {
111
111
* events.offer(event)
112
112
* }
113
113
*
114
- * val uiUpdater = launch(UI , parent = UILifecycle) {
114
+ * val uiUpdater = launch(Dispatchers.Main , parent = UILifecycle) {
115
115
* events.consume {}
116
116
* events.cancel()
117
117
* }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import kotlin.coroutines.*
40
40
* }
41
41
*
42
42
* // Usage
43
- * launch(UI + CoroutineName("Progress bar coroutine")) { ... }
43
+ * launch(Dispatchers.Main + CoroutineName("Progress bar coroutine")) { ... }
44
44
* ```
45
45
*
46
46
* Every time this coroutine is resumed on a thread, UI thread name is updated to
@@ -90,7 +90,7 @@ public interface ThreadContextElement<S> : CoroutineContext.Element {
90
90
* println(myThreadLocal.get()) // Prints "null"
91
91
* launch(Dispatchers.Default + myThreadLocal.asContextElement(value = "foo")) {
92
92
* println(myThreadLocal.get()) // Prints "foo"
93
- * withContext(UI ) {
93
+ * withContext(Dispatchers.Main ) {
94
94
* println(myThreadLocal.get()) // Prints "foo", but it's on UI thread
95
95
* }
96
96
* }
@@ -101,7 +101,7 @@ public interface ThreadContextElement<S> : CoroutineContext.Element {
101
101
*
102
102
* ```
103
103
* myThreadLocal.set("main")
104
- * withContext(UI ) {
104
+ * withContext(Dispatchers.Main ) {
105
105
* println(myThreadLocal.get()) // Prints "main"
106
106
* myThreadLocal.set("UI")
107
107
* }
You can’t perform that action at this time.
0 commit comments