File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,17 @@ internal fun systemProp(
56
56
return parsed
57
57
}
58
58
59
+ /* *
60
+ * Gets the system property indicated by the specified [property name][propertyName],
61
+ * or returns [defaultValue] if there is no property with that key.
62
+ *
63
+ * **Note: this function should be used in JVM tests only, other platforms use the default value.**
64
+ */
65
+ internal fun systemProp (
66
+ propertyName : String ,
67
+ defaultValue : String
68
+ ): String = systemProp(propertyName) ? : defaultValue
69
+
59
70
/* *
60
71
* Gets the system property indicated by the specified [property name][propertyName],
61
72
* or returns `null` if there is no property with that key.
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ import kotlinx.coroutines.internal.*
9
9
import java.util.concurrent.*
10
10
11
11
12
- // Internal debuggability name + thread name prefixes
13
- internal const val DEFAULT_SCHEDULER_NAME = " DefaultDispatcher"
12
+ /* *
13
+ * The name of the default scheduler. The names of the worker threads of [Dispatchers.Default] have it as their prefix.
14
+ */
15
+ @JvmField
16
+ internal val DEFAULT_SCHEDULER_NAME = systemProp(
17
+ " kotlinx.coroutines.scheduler.default.name" , " DefaultDispatcher"
18
+ )
14
19
15
20
// 100us as default
16
21
@JvmField
You can’t perform that action at this time.
0 commit comments