File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
core/kotlinx-coroutines-core/src Expand file tree Collapse file tree 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 {
5555 * This function is invoked before the coroutine in the specified [context] is resumed in the current thread
5656 * when the context of the coroutine this element.
5757 * 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.
5860 *
5961 * @param context the coroutine context.
6062 */
@@ -66,6 +68,8 @@ public interface ThreadContextElement<S> : CoroutineContext.Element {
6668 * if [updateThreadContext] was previously invoked on resume of this coroutine.
6769 * The value of [oldState] is the result of the previous invocation of [updateThreadContext] and it should
6870 * 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.
6973 *
7074 * @param context the coroutine context.
7175 * @param oldState the value returned by the previous invocation of [updateThreadContext].
You can’t perform that action at this time.
0 commit comments