File tree 1 file changed +4
-0
lines changed
core/kotlinx-coroutines-core/src
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ public interface ThreadContextElement<S> : CoroutineContext.Element {
55
55
* This function is invoked before the coroutine in the specified [context] is resumed in the current thread
56
56
* when the context of the coroutine this element.
57
57
* The result of this function is the old value of the thread-local state that will be passed to [restoreThreadContext].
58
+ * This method should handle its own exceptions and do not rethrow it. Thrown exceptions will leave coroutine which
59
+ * context is updated in an undefined state.
58
60
*
59
61
* @param context the coroutine context.
60
62
*/
@@ -66,6 +68,8 @@ public interface ThreadContextElement<S> : CoroutineContext.Element {
66
68
* if [updateThreadContext] was previously invoked on resume of this coroutine.
67
69
* The value of [oldState] is the result of the previous invocation of [updateThreadContext] and it should
68
70
* be restored in the thread-local state by this function.
71
+ * This method should handle its own exceptions and do not rethrow it. Thrown exceptions will leave coroutine which
72
+ * context is updated in an undefined state.
69
73
*
70
74
* @param context the coroutine context.
71
75
* @param oldState the value returned by the previous invocation of [updateThreadContext].
You can’t perform that action at this time.
0 commit comments