Activity.BindToCurrentThread 方法

定义

将用户定义的工作绑定到当前线程。Binds the user-defined work to the current thread.

public:
 void BindToCurrentThread();
public void BindToCurrentThread ();
member this.BindToCurrentThread : unit -> unit
Public Sub BindToCurrentThread ()

注解

BindToCurrentThread 将或方法提交的批处理工作绑定 SynchronousCall AsynchronousCall 到当前的单线程单元 (STA) 。BindToCurrentThread binds the batch work that is submitted by the SynchronousCall or AsynchronousCall methods to the current single-threaded apartment (STA). BindToCurrentThread 如果当前线程正在多线程单元 (MTA) 中运行,则不起作用。BindToCurrentThread has no effect if the current thread is being run in the multithreaded apartment (MTA). 当前线程模型由对象的属性的配置确定 ThreadPool ServiceConfigThe current thread model is determined by the configuration of the ThreadPool property of the ServiceConfig object.

适用于