The volatile keyword indicates that a field can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread.
ex: shows how to declare a public field variable as volatile.
// csharp_volatile.cs
class Test
{
public volatile int i;
Test(int _i)
{
i = _i;
}
public static void Main()
{
}
}
apple
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment