Volatile (keyword)

From The Oxygene Language Wiki

Jump to:navigation, search

Volatile is a keyword introduced with the May 2009 Release (3.0.19) that can be applied to fields that hint the runtime to not cache field values, but always use multi-core safe accessing instructions when accessing these fields. Applying volatile to a field can be done by writing the keyword, followed by a semicolon after the variable declaration.


type 
  MyClass = class
  private
    fField: Integer; volatile;
  end;

Volatile fields can only be: Reference types, IntPtr, UIntPtr, or integer and enum types of 32 bits or less.

Navigation
Areas
More
Toolbox