internal static void Install() { get_context get = GetCurrentSynchronizationContext; post_on_context post = PostOnSynchronizationContext; release_context release = ReleaseSynchronizationContext; is_on_context is_on = IsOnSynchronizationContext; // prevent the delegates from ever being garbage collected GCHandle.Alloc(get); GCHandle.Alloc(post); GCHandle.Alloc(release); GCHandle.Alloc(is_on); install_scheduler_callbacks(get, post, release, is_on); }
private static extern void install_scheduler_callbacks(get_context get, post_on_context post, release_context release, is_on_context is_on);