Skip to content

Commit 564a5a6

Browse files
Inegoelizarov
authored andcommitted
Change more "create new" to "create a"
1 parent 6da0ccd commit 564a5a6

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

docs/basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fun main() = runBlocking { // this: CoroutineScope
265265
println("Task from runBlocking")
266266
}
267267

268-
coroutineScope { // Creates a new coroutine scope
268+
coroutineScope { // Creates a coroutine scope
269269
launch {
270270
delay(500L)
271271
println("Task from nested launch")

docs/coroutine-context-and-dispatchers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The default dispatcher, that is used when coroutines are launched in [GlobalScop
105105
is represented by [Dispatchers.Default] and uses shared background pool of threads,
106106
so `launch(Dispatchers.Default) { ... }` uses the same dispatcher as `GlobalScope.launch { ... }`.
107107

108-
[newSingleThreadContext] creates a new thread for the coroutine to run.
108+
[newSingleThreadContext] creates a thread for the coroutine to run.
109109
A dedicated thread is a very expensive resource.
110110
In a real application it must be either released, when no longer needed, using [close][ExecutorCoroutineDispatcher.close]
111111
function, or stored in a top-level variable and reused throughout the application.

kotlinx-coroutines-core/common/src/Job.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public interface Job : CoroutineContext.Element {
341341
}
342342

343343
/**
344-
* Creates a new job object in an active state.
344+
* Creates a job object in an active state.
345345
* A failure of any child of this job immediately causes this job to fail, too, and cancels the rest of its children.
346346
*
347347
* To handle children failure independently of each other use [SupervisorJob].

kotlinx-coroutines-core/common/src/Supervisor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import kotlin.coroutines.intrinsics.*
1313
import kotlin.jvm.*
1414

1515
/**
16-
* Creates a new _supervisor_ job object in an active state.
16+
* Creates a _supervisor_ job object in an active state.
1717
* Children of a supervisor job can fail independently of each other.
1818
*
1919
* A failure or cancellation of a child does not cause the supervisor job to fail and does not affect its other children,

kotlinx-coroutines-core/jvm/src/ThreadPoolDispatcher.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.util.concurrent.atomic.AtomicInteger
1010
import kotlin.coroutines.*
1111

1212
/**
13-
* Creates a new coroutine execution context using a single thread with built-in [yield] support.
13+
* Creates a coroutine execution context using a single thread with built-in [yield] support.
1414
* **NOTE: The resulting [ExecutorCoroutineDispatcher] owns native resources (its thread).
1515
* Resources are reclaimed by [ExecutorCoroutineDispatcher.close].**
1616
*

kotlinx-coroutines-core/jvm/src/scheduling/CoroutineScheduler.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ internal class CoroutineScheduler(
367367
}
368368

369369
/**
370-
* Unparks or creates a new [Worker] for executing non-blocking tasks if there are idle cores
370+
* Unparks or creates a [Worker] for executing non-blocking tasks if there are idle cores
371371
*/
372372
private fun requestCpuWorker() {
373373
// No CPU available -- nothing to request
@@ -383,7 +383,7 @@ internal class CoroutineScheduler(
383383
*/
384384
if (tryUnpark()) return
385385
/*
386-
* Create a new thread.
386+
* Create a thread.
387387
* It's not preferable to use 'cpuWorkersCounter' here (moreover, it's implicitly here as corePoolSize - cpuPermits.availableTokens),
388388
* cpuWorkersCounter doesn't take into account threads which are created (and either running or parked), but haven't
389389
* CPU token: retiring workers, recently unparked workers before `findTask` call, etc.

kotlinx-coroutines-core/jvm/test/guide/example-basic-04.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fun main() = runBlocking { // this: CoroutineScope
1313
println("Task from runBlocking")
1414
}
1515

16-
coroutineScope { // Creates a new coroutine scope
16+
coroutineScope { // Creates a coroutine scope
1717
launch {
1818
delay(500L)
1919
println("Task from nested launch")

0 commit comments

Comments
 (0)