Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,22 @@ private static Continuation UnwindToPossibleHandler(Continuation continuation)
return continuation;
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static ExecutionContext? CaptureExecutionContext()
{
return Thread.CurrentThreadAssumedInitialized._executionContext;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void RestoreExecutionContext(ExecutionContext? previousExecutionCtx)
{
Thread thread = Thread.CurrentThreadAssumedInitialized;
ExecutionContext? currentExecutionCtx = thread._executionContext;
if (previousExecutionCtx != currentExecutionCtx)
{
ExecutionContext.RestoreChangedContextToThread(thread, previousExecutionCtx, currentExecutionCtx);
}
}
}
}
4 changes: 4 additions & 0 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,10 @@ struct CORINFO_ASYNC_INFO
// Whether or not the continuation needs to be allocated through the
// helper that also takes a method handle
bool continuationsNeedMethodHandle;
// Method handle for AsyncHelpers.CaptureExecutionContext
CORINFO_METHOD_HANDLE captureExecutionContextMethHnd;
// Method handle for AsyncHelpers.RestoreExecutionContext
CORINFO_METHOD_HANDLE restoreExecutionContextMethHnd;
};

// Flags passed from JIT to runtime.
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#include <minipal/guid.h>

constexpr GUID JITEEVersionIdentifier = { /* 2004006b-bdff-4357-8e60-3ae950a4f165 */
0x2004006b,
0xbdff,
0x4357,
{0x8e, 0x60, 0x3a, 0xe9, 0x50, 0xa4, 0xf1, 0x65}
constexpr GUID JITEEVersionIdentifier = { /* ce8cef5e-261f-469a-b599-9f3f3e8b2448 */
0xce8cef5e,
0x261f,
0x469a,
{0xb5, 0x99, 0x9f, 0x3f, 0x3e, 0x8b, 0x24, 0x48}
};

#endif // JIT_EE_VERSIONING_GUID_H
Loading
Loading