Last active
January 2, 2016 18:19
-
-
Save JakeGinnivan/8342493 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SyncCtx/IsThreadPool/ThreadId: System.Windows.Threading.DispatcherSynchronizationContext/False/8 | |
| SyncCtx/IsThreadPool/ThreadId: System.Windows.Threading.DispatcherSynchronizationContext/True/10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SyncCtx/IsThreadPool/ThreadId: System.Windows.Threading.DispatcherSynchronizationContext/False/8 | |
| SyncCtx/IsThreadPool/ThreadId: /True/11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using System.Windows; | |
| namespace WpfApplication3 | |
| { | |
| public partial class MainWindow | |
| { | |
| public MainWindow() | |
| { | |
| InitializeComponent(); | |
| } | |
| private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) | |
| { | |
| Debug.WriteLine("SyncCtx/IsThreadPool/ThreadId: {0}/{1}/{2}", SynchronizationContext.Current, Thread.CurrentThread.IsThreadPoolThread, | |
| Thread.CurrentThread.ManagedThreadId); | |
| await TaskEx.Run(() => Thread.Sleep(1000)).ConfigureAwait(false); | |
| Debug.WriteLine("SyncCtx/IsThreadPool/ThreadId: {0}/{1}/{2}", SynchronizationContext.Current, Thread.CurrentThread.IsThreadPoolThread, | |
| Thread.CurrentThread.ManagedThreadId); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Window x:Class="WpfApplication3.MainWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| Title="MainWindow" Height="350" Width="525"> | |
| <Grid> | |
| <Button Click="ButtonBase_OnClick" Content="Do Stuff" /> | |
| </Grid> | |
| </Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment