Thread.Thaw Method

Definition

Enables the thread to execute.

public:
 void Thaw();
Attributes

Examples

The following example demonstrates how to use the Thaw method.

public static void FreezeThawTest(DTE dte)  
{  
    // Setup debug Output window.  
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);  
    w.Visible = true;  
    OutputWindow ow = (OutputWindow)w.Object;  
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Thread Freeze Thaw Test");  
    owp.Activate();  

    EnvDTE.Threads threads = dte.Debugger.CurrentProgram.Threads;  
    owp.OutputString("There are " + threads.Count + " threads:\n");  
    foreach(EnvDTE.Thread thread in threads)  
    {  
        owp.OutputString("\nThread: " + thread.ID + "  Name: " + thread.Name);  
        owp.OutputString("\n  Is frozen                  : " + thread.IsFrozen);  
        owp.OutputString("\n  Freezing . . . ");  
        thread.Freeze();  
        owp.OutputString("\n  Is frozen                  : " + thread.IsFrozen);  
        owp.OutputString("\n  Thawing . . . ");  
        thread.Thaw();  
        owp.OutputString("\n  Is frozen                  : " + thread.IsFrozen);  
    }  
}  

Remarks

After a thread has been frozen, this method enables it to continue to execute.

Applies to