Skip to content

Commit 17f8935

Browse files
committed
fix build suggestions
1 parent 8055517 commit 17f8935

11 files changed

Lines changed: 19 additions & 19 deletions

File tree

docs/navigate/advanced-programming/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ items:
2121
- name: Synchronous wrappers for asynchronous methods
2222
href: ../../standard/asynchronous-programming-patterns/synchronous-wrappers-for-asynchronous-methods.md
2323
- name: ExecutionContext and SynchronizationContext
24-
href: ../../standard/asynchronous-programming-patterns/executioncontext-and-synchronizationcontext.md
24+
href: ../../standard/asynchronous-programming-patterns/executioncontext-synchronizationcontext.md
2525
- name: SynchronizationContext and console apps
26-
href: ../../standard/asynchronous-programming-patterns/synchronizationcontext-and-console-apps.md
26+
href: ../../standard/asynchronous-programming-patterns/synchronizationcontext-console-apps.md
2727
- name: Event-based asynchronous pattern (EAP)
2828
items:
2929
- name: Documentation overview

docs/standard/asynchronous-programming-patterns/executioncontext-and-synchronizationcontext.md renamed to docs/standard/asynchronous-programming-patterns/executioncontext-synchronizationcontext.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ When you work with `async` and `await`, two context types play important but ver
2626

2727
<xref:System.Threading.ExecutionContext> is captured with <xref:System.Threading.ExecutionContext.Capture?displayProperty=nameWithType> and restored during execution of a delegate via <xref:System.Threading.ExecutionContext.Run*?displayProperty=nameWithType>:
2828

29-
:::code language="csharp" source="./snippets/executioncontext-and-synchronizationcontext/csharp/Program.cs" id="ExecutionContextCapture":::
30-
:::code language="vb" source="./snippets/executioncontext-and-synchronizationcontext/vb/Program.vb" id="ExecutionContextCapture":::
29+
:::code language="csharp" source="./snippets/executioncontext-synchronizationcontext/csharp/Program.cs" id="ExecutionContextCapture":::
30+
:::code language="vb" source="./snippets/executioncontext-synchronizationcontext/vb/Program.vb" id="ExecutionContextCapture":::
3131

3232
All asynchronous APIs in .NET that fork work—<xref:System.Threading.Tasks.Task.Run*>, <xref:System.Threading.ThreadPool.QueueUserWorkItem*>, <xref:System.IO.Stream.BeginRead*>, and others—capture <xref:System.Threading.ExecutionContext> and use the stored context when invoking your callback. This process of capturing state on one thread and restoring it on another is what "flowing ExecutionContext" means.
3333

@@ -41,8 +41,8 @@ All asynchronous APIs in .NET that fork work—<xref:System.Threading.Tasks.Task
4141

4242
By using <xref:System.Threading.SynchronizationContext> instead of framework-specific marshaling APIs, you can write components that work across UI frameworks:
4343

44-
:::code language="csharp" source="./snippets/executioncontext-and-synchronizationcontext/csharp/Program.cs" id="SyncContextUsage":::
45-
:::code language="vb" source="./snippets/executioncontext-and-synchronizationcontext/vb/Program.vb" id="SyncContextUsage":::
44+
:::code language="csharp" source="./snippets/executioncontext-synchronizationcontext/csharp/Program.cs" id="SyncContextUsage":::
45+
:::code language="vb" source="./snippets/executioncontext-synchronizationcontext/vb/Program.vb" id="SyncContextUsage":::
4646

4747
### Capturing a SynchronizationContext
4848

@@ -101,8 +101,8 @@ This is the most important point: <xref:System.Threading.SynchronizationContext.
101101

102102
Consider code that offloads work to the thread pool from a UI thread:
103103

104-
:::code language="csharp" source="./snippets/executioncontext-and-synchronizationcontext/csharp/Program.cs" id="TaskRunExample":::
105-
:::code language="vb" source="./snippets/executioncontext-and-synchronizationcontext/vb/Program.vb" id="TaskRunExample":::
104+
:::code language="csharp" source="./snippets/executioncontext-synchronizationcontext/csharp/Program.cs" id="TaskRunExample":::
105+
:::code language="vb" source="./snippets/executioncontext-synchronizationcontext/vb/Program.vb" id="TaskRunExample":::
106106

107107
If <xref:System.Threading.SynchronizationContext> flowed across `await` points, the `await` inside the delegate passed to <xref:System.Threading.Tasks.Task.Run*?displayProperty=nameWithType> would see the UI context as `Current`. The continuation after `await DownloadAsync()` would then post back to the UI thread, causing `Compute(data)` to run on the UI thread instead of on the thread pool. That defeats the purpose of the `Task.Run` call.
108108

@@ -122,4 +122,4 @@ Because the runtime suppresses <xref:System.Threading.SynchronizationContext> fl
122122

123123
- [Task-based asynchronous pattern (TAP)](task-based-asynchronous-pattern-tap.md)
124124
- [Consume the task-based asynchronous pattern](consuming-the-task-based-asynchronous-pattern.md)
125-
- [SynchronizationContext and console apps](synchronizationcontext-and-console-apps.md)
125+
- [SynchronizationContext and console apps](synchronizationcontext-console-apps.md)

docs/standard/asynchronous-programming-patterns/snippets/executioncontext-and-synchronizationcontext/csharp/ExecutionContextAndSyncContext.csproj renamed to docs/standard/asynchronous-programming-patterns/snippets/executioncontext-synchronizationcontext/csharp/ExecutionContextAndSyncContext.csproj

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/executioncontext-and-synchronizationcontext/csharp/Program.cs renamed to docs/standard/asynchronous-programming-patterns/snippets/executioncontext-synchronizationcontext/csharp/Program.cs

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/executioncontext-and-synchronizationcontext/vb/ExecutionContextAndSyncContext.vbproj renamed to docs/standard/asynchronous-programming-patterns/snippets/executioncontext-synchronizationcontext/vb/ExecutionContextAndSyncContext.vbproj

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/executioncontext-and-synchronizationcontext/vb/Program.vb renamed to docs/standard/asynchronous-programming-patterns/snippets/executioncontext-synchronizationcontext/vb/Program.vb

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-and-console-apps/csharp/Program.cs renamed to docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-console-apps/csharp/Program.cs

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-and-console-apps/csharp/SyncContextConsoleApps.csproj renamed to docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-console-apps/csharp/SyncContextConsoleApps.csproj

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-and-console-apps/vb/Program.vb renamed to docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-console-apps/vb/Program.vb

File renamed without changes.

docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-and-console-apps/vb/SyncContextConsoleApps.vbproj renamed to docs/standard/asynchronous-programming-patterns/snippets/synchronizationcontext-console-apps/vb/SyncContextConsoleApps.vbproj

File renamed without changes.

0 commit comments

Comments
 (0)