What sets IsFaulted to false?

I understand that IsFaulted is a property that can only be used with Get and what it is used for, but I had trouble understanding when and when it was ever changed from true to false. Most of the sites that I see on the Internet discuss what it is used for and maybe check it out, but I don’t see them ever changing it intentionally or through some kind of work.

+3
source share
2 answers

I assume that you are talking about Task.IsFaulted.

It changes to trueif during execution of tasks there is an exception without participation. Its condition depends on the internal flags set inside.

IsFaulted , :

public bool IsFaulted 
{ 
    get
    { 
        // Faulted is "king" -- if that bit is present (regardless of other bits), we are faulted.
        return ((m_stateFlags & TASK_STATE_FAULTED) != 0);
    }
} 
+3

, . - ( , ), ContinueWith Task. , IsFaulted.

, , , . , , Task, , . , , .

, - , , , , , . ContinueWith. , , , , , , . Task, , , .

0

All Articles