public enum MethodImplOptions
Object
ValueType
Enum
MethodImplOptions
mscorlib
RuntimeInfrastructure
Defines the details of how a method is implemented.
This enumeration is used by MethodImplAttribute.
System.Runtime.CompilerServices Namespace
MethodImplOptions Fields
MethodImplOptions.ForwardRef Field
MethodImplOptions.InternalCall Field
MethodImplOptions.NoInlining Field
MethodImplOptions.Synchronized Field
MethodImplOptions.Unmanaged Field
MethodImplOptions.value__ Field
ForwardRef = 16;
Specifies that the method is declared, but its implementation is provided elsewhere.[Note: For most languages, it is recommended that the notion of "forward" be attached to methods using language syntax instead of custom attributes. ]
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace
InternalCall = 4096;
Specifies an internal call.[Note: An internal call is a call to a method implemented within the system itself, providing additional functionality that regular managed code cannot provide. System.Object.MemberwiseClone is an example of an internally called method.]
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace
NoInlining = 8;
Specifies that the method is not permitted to be inlined.
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace
Synchronized = 32;
Specifies the method can be executed by only one thread at a time.This option specifies that before a thread can execute the target method, the thread is required to acquire a lock on either the current instance or the Type object for the method's class. If the target method is an instance method, the lock is on the current instance. If the target is a static method, the lock is on the Type object. Specifying this option causes the target method to behave as though its statements are enclosed by System.Threading.Monitor.Enter(System.Object) and System.Threading.Monitor.Exit(System.Object) statements locking the previous described object. This option and the Monitor methods are functionally equivalent, and both are functionally equivalent to enclosing the target method's code in a C# lock (this) statement.
[Note: Because this option holds the lock for the duration of the target method, it should be used only when the entire method must be single threaded. Use the Monitor methods (or the C# lock statement) if the object lock can be taken after the method begins, or released before the method ends. Any mechanism that uses locks can cause an application to experience deadlocks and performance degradation; for these reasons, use this option with care.
For most languages, it is recommended that the notion of "synchronized" be attached to methods using language syntax instead of custom attributes.
]
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace
Unmanaged = 4;
Specifies that the method is implemented in unmanaged code.
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace
value__;
System.Runtime.CompilerServices.MethodImplOptions Enum, System.Runtime.CompilerServices Namespace