File tree 2 files changed +24
-2
lines changed
2 files changed +24
-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,19 @@ 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
+ * Name of the default scheduler.
14
+ *
15
+ * Customization provided for when there's no control over used dispatchers/schedulers (i.e when
16
+ * [Dispatchers.Default] is used within third-party libraries), or when overall default configuration
17
+ * is acceptable and only the default scheduler name needs to be changed.
18
+ *
19
+ * Useful for filtering log messages.
20
+ */
21
+ @JvmField
22
+ internal val DEFAULT_SCHEDULER_NAME = systemProp(
23
+ " kotlinx.coroutines.scheduler.default.name" , " DefaultDispatcher"
24
+ )
14
25
15
26
// 100us as default
16
27
@JvmField
You can’t perform that action at this time.
0 commit comments