Open sandboxFocus

Class ThreadMismatchException

Exception thrown when a thread attempts to access an object that has affinity to another thread.

Inheritance
ThreadMismatchException
Implements
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
public sealed class ThreadMismatchException : ThreadingException, ISerializable
Remarks

The following threading models throw this exception: ThreadAffineAttribute when the object is accessed from a different thread than the one that created it, and ActorAttribute when a field is accessed from a context that does not have access to the actor, both only when run-time verification is enabled (see RuntimeVerificationEnabled); and ImmutableAttribute and FreezableAttribute when the object is accessed from a different thread than the one that created it before it has been made read-only.

Constructors

Name Description
ThreadMismatchException()

Initializes a new instance of the ThreadMismatchException class.

ThreadMismatchException(string)

Initializes a new instance of the ThreadMismatchException class and sets the error message.

ThreadMismatchException(string, Exception)

Initializes a new instance of the ThreadMismatchException class and sets the error message and the inner exception.

See Also