在某一线程里调用另一线程join方法时,表示将后者阻塞直至前者终止时再执行
比如
System.Threading.Thread x=new System.Threading.Thread(new System.Threading.ThreadStart(f1));
System.Threading.Thread y=new System.Threading.Thread(new System.Threading.ThreadStart(f2));void f1()
{
...
y.join();
}void f2()
{
...
}y要在x终止后才能运行
比如
System.Threading.Thread x=new System.Threading.Thread(new System.Threading.ThreadStart(f1));
System.Threading.Thread y=new System.Threading.Thread(new System.Threading.ThreadStart(f2));void f1()
{
...
y.join();
}void f2()
{
...
}y要在x终止后才能运行
阻塞调用线程,直到某个线程终止时为止。[Visual Basic] Overloads Public Sub Join()
[C#] public void Join();
[C++] public: void Join();
[JScript] public function Join();
阻塞调用线程,直到某个线程终止或者经过了指定的时间为止。[Visual Basic] Overloads Public Function Join(Integer) As Boolean
[C#] public bool Join(int);
[C++] public: bool Join(int);
[JScript] public function Join(int) : Boolean;
阻塞调用线程,直到某个线程终止或者经过了指定的时间为止。[Visual Basic] Overloads Public Function Join(TimeSpan) As Boolean
[C#] public bool Join(TimeSpan);
[C++] public: bool Join(TimeSpan);
[JScript] public function Join(TimeSpan) : Boolean;