@@ -38,7 +38,7 @@ import kotlin.coroutines.experimental.CoroutineContext
38
38
* or completion of parent immediately cancels all its children.
39
39
*
40
40
* The most basic instances of [Job] are created with [launch] coroutine builder or with a
41
- * [ `Job()`][Job.Key.invoke] factory function. Other coroutine builders and primitives like
41
+ * `Job()` factory function. Other coroutine builders and primitives like
42
42
* [Deferred] also implement [Job] interface.
43
43
*
44
44
* A job has the following states:
@@ -57,7 +57,7 @@ import kotlin.coroutines.experimental.CoroutineContext
57
57
*
58
58
* A job can be _cancelled_ at any time with [cancel] function that forces it to transition to
59
59
* _cancelling_ state immediately. Simple jobs, that are not backed by a coroutine, like
60
- * [CompletableDeferred] and the result of [ `Job()`][Job.Key.invoke] factory function, don't
60
+ * [CompletableDeferred] and the result of `Job()` factory function, don't
61
61
* have a _cancelling_ state, but become _cancelled_ on [cancel] immediately.
62
62
* Coroutines, on the other hand, become _cancelled_ only when they finish executing their code.
63
63
*
@@ -92,8 +92,10 @@ public interface Job : CoroutineContext.Element {
92
92
/* *
93
93
* Creates a new job object in _active_ state.
94
94
* It is optionally a child of a [parent] job.
95
+ * @suppress **Deprecated**
95
96
*/
96
- public operator fun invoke (parent : Job ? = null): Job = JobImpl (parent)
97
+ @Deprecated(" Replaced with top-level function" , level = DeprecationLevel .HIDDEN )
98
+ public operator fun invoke (parent : Job ? = null): Job = Job (parent)
97
99
}
98
100
99
101
// ------------ state query ------------
@@ -251,6 +253,12 @@ public interface Job : CoroutineContext.Element {
251
253
}
252
254
}
253
255
256
+ /* *
257
+ * Creates a new job object in an _active_ state.
258
+ * It is optionally a child of a [parent] job.
259
+ */
260
+ public fun Job (parent : Job ? = null): Job = JobImpl (parent)
261
+
254
262
/* *
255
263
* A handle to an allocated object that can be disposed to make it eligible for garbage collection.
256
264
*/
0 commit comments