Repository: Kotlin/kotlinx.coroutines
File: kotlinx-coroutines-core/common/src/Job.kt (Kotlin)

Code before:
 *
 * All functions on this interface and on all interfaces derived from it are **thread-safe** and can
 * be safely invoked from concurrent coroutines without external synchronization.
 *
 * ### Not stable for inheritance
 *
 * **`Job` interface and all its derived interfaces are not stable for inheritance in 3rd party libraries**,
 * as new methods might be added to this interface in the future, but is stable for use.
 */
public interface Job : CoroutineContext.Element {
    /**
     * Key for [Job] instance in the coroutine context.
     */
    public companion object Key : CoroutineContext.Key<Job>

    // ------------ state query ------------

    /**
     * Returns a parent of the current job if the parent-child relationship
     * is established or `null` if the job has no parent or was successfully completed.
     *
     * Accesses to this property are not idempotent, the property becomes `null` as soon
     * as the job is transitioned to its final state, whether it is cancelled or completed,
     * and all job children are completed.
     *
     * For coroutines, its corresponding job completes as soon as the coroutine itself
     * and all its children are complete.
     *
     * @see [Job] state transitions for additional details.
     */
    @ExperimentalCoroutinesApi
    public val parent: Job?

    /**
     * Returns `true` when this job is active -- it was already started and has not completed nor was cancelled yet.
     * The job that is waiting for its [children] to complete is still considered to be active if it
     * was not cancelled nor failed.
     *
     * See [Job] documentation for more details on job states.
     */
    public val isActive: Boolean

    /**
     * Returns `true` when this job has completed for any reason. A job that was cancelled or failed
     * and has finished its execution is also considered complete. Job becomes complete only after
     * all its [children] complete.
     *
     * See [Job] documentation for more details on job states.
     */
    public val isCompleted: Boolean


Review comment (suggestion):
```suggestion
     * For a coroutine, its corresponding job completes as soon as the coroutine itself
```

Code after:
 *
 * All functions on this interface and on all interfaces derived from it are **thread-safe** and can
 * be safely invoked from concurrent coroutines without external synchronization.
 *
 * ### Not stable for inheritance
 *
 * **`Job` interface and all its derived interfaces are not stable for inheritance in 3rd party libraries**,
 * as new methods might be added to this interface in the future, but is stable for use.
 */
public interface Job : CoroutineContext.Element {
    /**
     * Key for [Job] instance in the coroutine context.
     */
    public companion object Key : CoroutineContext.Key<Job>

    // ------------ state query ------------

    /**
     * Returns the parent of the current job if the parent-child relationship
     * is established or `null` if the job has no parent or was successfully completed.
     *
     * Accesses to this property are not idempotent, the property becomes `null` as soon
     * as the job is transitioned to its final state, whether it is cancelled or completed,
     * and all job children are completed.
     *
     * For a coroutine, its corresponding job completes as soon as the coroutine itself
     * and all its children are complete.
     *
     * @see [Job] state transitions for additional details.
     */
    @ExperimentalCoroutinesApi
    public val parent: Job?

    /**
     * Returns `true` when this job is active -- it was already started and has not completed nor was cancelled yet.
     * The job that is waiting for its [children] to complete is still considered to be active if it
     * was not cancelled nor failed.
     *
     * See [Job] documentation for more details on job states.
     */
    public val isActive: Boolean

    /**
     * Returns `true` when this job has completed for any reason. A job that was cancelled or failed
     * and has finished its execution is also considered complete. Job becomes complete only after
     * all its [children] complete.
     *
     * See [Job] documentation for more details on job states.
     */
    public val isCompleted: Boolean